You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
draft-js throws cannot read property 'update' of undefined when I type on selected text. To reproduce it, go to https://draftjs.org and type:
012
012
012
Then select the '1' of the second line. Now try to type '1'. Now type '2', it'll work. Now if you select the '2' that was just inserted and try to type '1' again, it'll not update.
Uncaught TypeError: Cannot read property 'update' of undefined
at editOnBeforeInput (editOnBeforeInput.js:101)
at DraftEditor.react.js:146
at HTMLUnknownElement.callCallback (react-dom.development.js:542)
at Object.invokeGuardedCallbackDev (react-dom.development.js:581)
at Object.invokeGuardedCallback (react-dom.development.js:438)
at Object.invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:452)
at executeDispatch (react-dom.development.js:836)
at executeDispatchesInOrder (react-dom.development.js:858)
at executeDispatchesAndRelease (react-dom.development.js:956)
at executeDispatchesAndReleaseTopLevel (react-dom.development.js:967)
at Array.forEach (<anonymous>)
at forEachAccumulated (react-dom.development.js:935)
at processEventQueue (react-dom.development.js:1112)
at runEventQueueInBatch (react-dom.development.js:3607)
at handleTopLevel (react-dom.development.js:3616)
at handleTopLevelImpl (react-dom.development.js:3347)
at batchedUpdates (react-dom.development.js:11082)
at batchedUpdates (react-dom.development.js:2330)
at dispatchEvent (react-dom.development.js:3421)
which is happening because of this.update, I believe it should be editor.update here:
Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
draft-js throws
cannot read property 'update' of undefined
when I type on selected text. To reproduce it, go to https://draftjs.org and type:Then select the '1' of the second line. Now try to type '1'. Now type '2', it'll work. Now if you select the '2' that was just inserted and try to type '1' again, it'll not update.
Here's a gif demonstrating the bug:
abc
instead of012
What is the expected behavior?
No errors thrown and the text should be updated correctly.
Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?
draft-js: 0.10.4
OS: Windows 10
Browser: Chrome 62, Firefox 56
I don't know if it worked on previous versions of draft-js. I'm a new user 😄
The text was updated successfully, but these errors were encountered: