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

Draft.js example crashes with Linux input method on Node.removeChild

Open wengxt opened this issue 3 years ago • 1 comments

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

Bug, might be a dup of https://github.com/facebook/draft-js/issues/1320 , but I don't have mac so I can't confirm.

What is the current behavior?

If input method directly send commit string request (no preedit presents) with a empty editor, draft.js would just crash. For example, using Pinyin and press "." (period).

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

https://jsfiddle.net/gmertk/e61z7nfa/ this can be used to reproduce the bug.

https://user-images.githubusercontent.com/259684/152080190-cd3c1113-fce2-4724-b1f2-89369480f646.mp4

If I add this to the editor class, it will reproduce exactly https://bugzilla.mozilla.org/show_bug.cgi?id=1735227.

    componentDidCatch() {
        this.forceUpdate();
    }

https://user-images.githubusercontent.com/259684/152080212-32b459d6-0eb6-40ae-88f4-4bf11a8965da.mp4

What is the expected behavior?

Text can be typed into the editor.

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

Linux, draft.js 0.11.7, Fcitx/IBus, firefox 97 I believe this affects twitter.com / facebook.com 's post box.

wengxt avatar Feb 02 '22 01:02 wengxt

I just typed at https://draftjs.org/ and the whole page became blank....

lilydjwg avatar Feb 05 '22 12:02 lilydjwg