ianstormtaylor / slate

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

Exiting IME composition during selecting paragraphs causes crash #3604

Closed jeiea closed 4 years ago

jeiea commented 4 years ago

It is the same as #967, but all related issues are closed.

Bug environment

Slate: online demo and 0.57.1 Browser: Chrome OS: windows / archlinux

What I did

  1. Select 2 paragraphs or more
  2. Start composition of hangeul(asian character) ㄴ by pressing s
  3. Press enter key

What I expected

Pressing enter should change the selection to a new paragraph.

What I get

crash gif

Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
    at removeChild (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:7601:18)
    at unmountHostComponents (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:20449:9)
    at commitDeletion (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:20500:5)
    at commitMutationEffects (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:22782:11)
    at HTMLUnknownElement.callCallback (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:188:14)
    at Object.invokeGuardedCallbackDev (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:237:16)
    at invokeGuardedCallback (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:292:31)
    at commitRootImpl (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:22509:9)
    at unstable_runWithPriority (https://cvf0c.csb.app/node_modules/scheduler/cjs/scheduler.development.js:653:12)
    at runWithPriority$1 (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:11039:10)
    at commitRoot (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:22381:3)
    at finishSyncRender (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:21807:3)
    at performSyncWorkOnRoot (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:21793:7)
    at eval (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:11089:24)
    at unstable_runWithPriority (https://cvf0c.csb.app/node_modules/scheduler/cjs/scheduler.development.js:653:12)
    at runWithPriority$1 (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:11039:10)
    at flushSyncCallbackQueueImpl (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:11084:7)
    at flushSyncCallbackQueue (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:11072:3)
    at Object.batchedUpdates$1 [as unstable_batchedUpdates] (https://cvf0c.csb.app/node_modules/react-dom/cjs/react-dom.development.js:21862:7)
    at Object.e.onChange (https://cvf0c.csb.app/node_modules/slate-react/dist/index.js:1867:14)
    at eval (https://cvf0c.csb.app/node_modules/slate/dist/index.js:101:18)
jeiea commented 4 years ago

Close as duplicate of #3292.