wxik / react-native-rich-editor

Lightweight React Native (JavaScript, H5) rich text editor
https://wxik.github.io/react-native-rich-editor/web
MIT License
806 stars 303 forks source link

Ordered List is not working properly in all android devices #200

Open ThejazR opened 3 years ago

ThejazR commented 3 years ago

For example in realme and samsung devices its showing as

1 Apple 1 Orange 1 Mango

Expected

  1. Apple
  2. orange
  3. mango

Alwasys 1 is coming the subsequent numbers like 2 , 3, .... are not coming.

swalahamani commented 3 years ago

I'm also getting the same issue.

Seems like the editor creates a separate set of <ul>---</ul> while tapping either return-key or selecting any suggestion on keyboard

swalahamani commented 3 years ago

Seems like related to #120

ThejazR commented 3 years ago

@swalahamani You can fix this buy disabling the autocorrect or text prediction option from the mobile keyboard.

LOMFM commented 3 years ago

@ThejazR Without disabling those options, Can I fix this error?

apprisemobile-lyu commented 2 years ago

I am also experiencing this on multiple Android devices. When I add a new number it works correctly until I try to focus the next list item in order to add text.

1. 2. 3.

becomes

1. 2.

  1. text here

This issue also occurs for bullet lists.

swalahamani commented 2 years ago

@swalahamani You can fix this by disabling the autocorrect or text prediction option from the mobile keyboard.

Yeah, that is correct. But it seems like the only way to do that is via the settings app and couldn't find any programmatical way.

shijinwu commented 2 years ago

in editor.js
function formatParagraph(async) if (async == true) return; Can solved I don't know if there will be any other problems

stulip commented 2 years ago

@shijinwu Can you provideinitialContentHTML for me to test

BadhanGanesh-HappyFox commented 2 years ago

@stulip This does not need initial content. Here are the steps to reproduce though:

  1. With the editor empty, type "Hello".
  2. Press Enter 2 times.
  3. Tap on the number list icon.
  4. Type "One" and then press enter.
  5. Type "Two".

Expected Output

Hello

  1. One
  2. Two

Actual Output:

Hello

1.One

1.Two

Kirysha commented 1 year ago

RichEditor supports html props, which was forgotten to be mentioned in the documentation. I moved the createHtml function to my project and modified it to solve this problem. #245

sujathasperi2022 commented 1 year ago

So whats the fix?

Kirysha commented 1 year ago

@sujathasperi2022

addEventListener(content, 'compositionstart', function(event){
    compositionStatus = 1;
})
addEventListener(content, 'compositionend', function (event){
    compositionStatus = 0;
    paragraphStatus && formatParagraph(true);
})

I commented out these lines in the html file these lines are only needed if you want to use hieroglyphs in your application.

Kirysha commented 1 year ago

I added my idea to the pull request. You can watch this #314 .