question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ctrl+z with empty history causes crash

See original GitHub issue

Do 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:closed
  • Created 5 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
klis87commented, Dec 17, 2018

@ianstormtaylor I just updated slate to 0.43.7 and slate-react to 0.20.8, I cannot reproduce this error anymore so I am closing, thx for great update, all issues I had in 0.42 are gone 👍

0reactions
ianstormtaylorcommented, Nov 6, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found