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

Add check for document.activeElement == INPUT before undo/redo #3827

Merged
merged 1 commit into from Jul 20, 2023

Conversation

cmdcolin
Copy link
Collaborator

@cmdcolin cmdcolin commented Jul 20, 2023

I found that there is a field called document.activeElement. We can check it for html tag type INPUT to avoid undo'ing in this case

This helps us preserve the browser behavior of undo in a text field while keeping the browser-native ctrl+z hotkey

Fixes #3638

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Jul 20, 2023
@cmdcolin cmdcolin added enhancement New feature or request and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Jul 20, 2023
@cmdcolin cmdcolin changed the title Add check for document.activeElement being an INPUT before app undo/redo Add check for document.activeElement == INPUT before undo/redo Jul 20, 2023
@cmdcolin cmdcolin merged commit de5b417 into main Jul 20, 2023
4 checks passed
@cmdcolin cmdcolin deleted the undo_redo_activeelement_check branch July 20, 2023 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ctrl+z inside textfield does (unexpected?) top-level undo on the state tree
1 participant