draft-js icon indicating copy to clipboard operation
draft-js copied to clipboard

Can't type a text when previously remove all text from editor on Android

Open Dmitry2703 opened this issue 5 years ago • 6 comments

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.

Dmitry2703 avatar Nov 06 '19 01:11 Dmitry2703

I have the same problem

aminkhademian avatar Jan 26 '20 12:01 aminkhademian

Is this still an issue in v11.4?

mrkev avatar Jan 30 '20 06:01 mrkev

Same Here is the overall behaviour:

  1. 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 })
    }}
/>
  1. When you delete some letters of the word, still the same behaviour: only the first letter is caught
  2. When you delete the only letter of the word, onChange method doesn't see it
  3. 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 and Uncaught 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...

arnaudambro avatar Feb 14 '20 07:02 arnaudambro

Any update?

danilkinkin avatar Jul 13 '21 10:07 danilkinkin

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

TrySpace avatar Jan 26 '22 05:01 TrySpace

Any updates?