ianstormtaylor / slate

A completely customizable framework for building rich text editors. (Currently in beta.)
http://slatejs.org
MIT License
29.71k stars 3.24k forks source link

[bug] Error when using Chinese Input Method #844

Closed terryoy closed 7 years ago

terryoy commented 7 years ago

Hi, I'm using Chrome on OSX.

I'm trying to use slatejs in a Chinese environment. I find out the Pinyin method will cause exceptions sometimes.

I made a test on the Rich Text demo. http://slatejs.org/#/rich-text

After typing a few letters, usually there will be a Chinese Character/Word assist that you can choose to put in the line. If I press space, the charater/word should be chosen and show in the editor.

But when I press space, the editor throws exceptions instead. I'm trying to figure out why and log an issue here first.

build.prod.js:22435 Uncaught TypeError: Cannot read property 'firstChild' of null
    at findDeepestNode (build.prod.js:22435)
    at Content.updateSelection (build.prod.js:6439)
    at Content.componentDidUpdate (build.prod.js:6371)
    at CallbackQueue.notifyAll (build.prod.js:116950)
    at ReactReconcileTransaction.close (build.prod.js:127356)
    at ReactReconcileTransaction.closeAll (build.prod.js:130323)
    at ReactReconcileTransaction.perform (build.prod.js:130270)
    at ReactUpdatesFlushTransaction.perform (build.prod.js:130257)
    at ReactUpdatesFlushTransaction.perform (build.prod.js:128377)
    at Object.flushBatchedUpdates (build.prod.js:128460)
findDeepestNode @   build.prod.js:22435
updateSelection @   build.prod.js:6439
componentDidUpdate  @   build.prod.js:6371
notifyAll   @   build.prod.js:116950
close   @   build.prod.js:127356
closeAll    @   build.prod.js:130323
perform @   build.prod.js:130270
perform @   build.prod.js:130257
perform @   build.prod.js:128377
flushBatchedUpdates @   build.prod.js:128460
closeAll    @   build.prod.js:130323
perform @   build.prod.js:130270
batchedUpdates  @   build.prod.js:124764
batchedUpdates  @   build.prod.js:128385
dispatchEvent   @   build.prod.js:125162

Screen Recording: http://recordit.co/H6YToYThiX

ianstormtaylor commented 7 years ago

Closing in favor of https://github.com/ianstormtaylor/slate/issues/854 which I believe is the same issue?

liuningnb commented 6 years ago

1209