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

Issue with undo on custom block components

Open mshibl opened this issue 9 years ago • 2 comments

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

steps to reproduce? 1- Add new custom component 2- Undo last step (using CMD+Z or CTRL+Z) --> cursor will jump to the far right of the screen 3- Try to type anything --> Cursor will type the first character normally --> next letter will jump to next line, while cursor is still on the first line --> next letter, all text on the first line is copied to next line

Demo Issue

Which versions of Draft.js, and which browser / OS are affected by this issue? "draft-js": "0.10.0" - Chrome

mshibl avatar Apr 05 '17 16:04 mshibl

This same issue can be seen when running the TeX Editor example in the examples/draft-0-10-0 folder

mshibl avatar Apr 05 '17 16:04 mshibl

Thanks for documenting this - it does indeed reproduce in the TeX Editor and is still an issue in Draft 0.10.1. I saw this error thrown:

app.js:26460 Uncaught TypeError: Cannot read property 'replaceChild' of null
    at Function.replaceChildWithTree (app.js:26460)
    at Object.dangerouslyReplaceNodeWithMarkup (app.js:26897)
    at Object.dangerouslyReplaceNodeWithMarkup [as replaceNodeWithMarkup] (app.js:26284)
    at ReactCompositeComponentWrapper._replaceNodeWithMarkup (app.js:32313)
    at ReactCompositeComponentWrapper._updateRenderedComponent (app.js:32303)
    at ReactCompositeComponentWrapper._performComponentUpdate (app.js:32253)
    at ReactCompositeComponentWrapper.updateComponent (app.js:32174)
    at ReactCompositeComponentWrapper.receiveComponent (app.js:32076)
    at Object.receiveComponent (app.js:24245)
    at Object.updateChildren (app.js:31347)

Edit: Thanks for submitting a fix! We've got a backlog of PRs to look at but I'm adding that one to my queue, will look at getting it merged asap.

flarnie avatar Jun 15 '17 22:06 flarnie