facebookarchive / draft-js

A React framework for building text editors.
https://draftjs.org/
MIT License
22.58k stars 2.64k forks source link

Pressing return jumps to start of line in Android API 33 #3169

Open tseringn opened 2 years ago

tseringn commented 2 years ago

Do you want to request a feature or report a bug?

bug

What is the current behavior?

Currently the pressing return in keyboard jumps start of the line in Android 13, but when entering space and then pressing return goes as expected to the next line. Did some debugging and found

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. You can use this jsfiddle to get started: https://jsfiddle.net/gmertk/e61z7nfa/.

used default code in the above jsfiddle link

Screen Record of actual bug

https://user-images.githubusercontent.com/62776949/192414726-8e3bf5a3-f60f-40e5-903c-70e7c4203f9b.mov

What is the expected behavior?

pressing return should go to next line

Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?

latest draft js, Android 13 pixel 5 vm, on MacOs 12.6

--EDIT-- The editorState.getCurrentInlineStyle() does not returns an empty array even if there are bunch of inline styles, until white space is encountered

tseringn commented 2 years ago

This is pretty serious bug for me, so a workaround or a fix will be very much appreciated