Ctrl+z with empty history causes crash
See original GitHub issueDo you want to request a feature or report a bug?
Bug
What’s the current behavior?
If there is no history, undo
will throw Cannot read property 'object' of undefined
https://codesandbox.io/s/98qo5jwk2p
What’s the expected behavior?
undo
shouldn’t crash when history is empty.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Ctrl+Z to undo on empty editor crashes the editor #1418 - GitHub
Creating an empty editor with html.deserialize(' '), and then pressing Ctrl+Z crashes the editor. Instead initialize with a raw value: Value ...
Read more >Ctrl+Z Deleted Files Recovery: Recover Files Lost by Ctrl+Z
Recover lost files from Ctrl+Z, accidental deletion, hard drive formatting, OS crash, virus attack, or other causes; you can use EaseUS Data ...
Read more >Disable Ctrl+Z shortcut or clear undo history in Windows ...
I wrote a program in C to disable both the Undo and Redo shortcuts, since both can lead to accidents.
Read more >CTRL + Z stops working all of a sudden???????????
Yes i get reversion to a previous state by going to the history palette and i can reverse to all previous states with...
Read more >[4.9.0] - Undo In Certain Case Causes Crash - C++
Without thinking, I accidently hit Ctrl+Z to undo and it caused an editor crash.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ianstormtaylor I just updated slate to
0.43.7
and slate-react to0.20.8
, I cannot reproduce this error anymore so I am closing, thx for great update, all issues I had in0.42
are gone 👍It sounds like the real issue is that the selection isn’t getting reset to the beginning of the document when removing the last node via
undo()
? It shouldn’t be possible to leave the document in an invalid state as far as normalization goes. But the selection might need to also have this behavior applied.