Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo when the editor is not in focus causes wrong data #5544

Closed
dislido opened this issue Oct 31, 2023 · 0 comments · Fixed by #5737
Closed

Undo when the editor is not in focus causes wrong data #5544

dislido opened this issue Oct 31, 2023 · 0 comments · Fixed by #5737
Labels

Comments

@dislido
Copy link

dislido commented Oct 31, 2023

Description
Undo when the editor is not in focus will change editor content, but won't update editor state.

Recording
GIF 2023-10-31 23-57-44

Sandbox
Just use slate example https://www.slatejs.org/examples/richtext

Steps
To reproduce the behavior:

  1. Input in the editor
  2. Click outside the editor
  3. Press ctrl+z/cmd+z, the editor will regain focus and undo last change
  4. Input, and the undo action has been undone

Expectation
The undo operation will execute correctly or be prevented.

Environment

  • Slate Version: 0.100.0
  • Operating System: windows 11; macOS 14.0
  • Browser: Edge 118.0.2088.76; Safari 17.0

Context
When you press ctrl+z, the editor(or any input element) that was last changed will regain focus and be undone, without related events fired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant