draft-js
draft-js copied to clipboard
Can't type a text when previously remove all text from editor on Android
Do you want to request a feature or report a bug? bug
What is the current behavior? When remove all text from editor then it's impossible to add a new text on Android 9.
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/. You can test in on draftjs homepage. Just add some text and then remove it. After it you can't add a new text.
What is the expected behavior? A new text should be added after removing old text and starting to type new text.
Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js? Tested with Draftjs v0.11.2 in Chrome browser on Android 9.
I have the same problem
Is this still an issue in v11.4?
Same Here is the overall behaviour:
- When you type a word, it starts to be underlined, and only the first letter of this word is caught by the
onChange
method, whatever letters are in the word. You can see it by doing
<EditorState
onChange={editorState => {
console.log(editorState.getCurrentContent().getPlainText('\n'));
this.setState({ editorState })
}}
/>
- When you delete some letters of the word, still the same behaviour: only the first letter is caught
- When you delete the only letter of the word,
onChange
method doesn't see it - When the word is the first one, and there are no letters to delete anymore, and you press
Delete
, errors are thrown:Uncaught Error: Got unexpected null or undefined at nullthrows
andUncaught Invariant Violation: Invalid DraftEditorContents node.
, and then you can't type anymore because for each lette typed the two errors are thrown.
I wonder if removing the autocorrect / autocomplete of Android would change something, but I don't know if it's possible to do it within draft-js...
Any update?
These bugs sound similar to those with slate and plate js. There seems to be a different API implementation than on desktop browsers, or perhaps the os
Any updates?