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

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

Closed
cmdcolin opened this issue Apr 12, 2023 · 6 comments · Fixed by #3827
Closed

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

cmdcolin opened this issue Apr 12, 2023 · 6 comments · Fixed by #3827
Labels
bug Something isn't working

Comments

@cmdcolin
Copy link
Collaborator

I opened a new linear genome view and was typing in a refnameautocomplete, a input textfield, and hit ctrl+z intending it to undo some text i typed, but instead it removed the whole linear genome view, because that was the last state tree action. It may be worth thinking about whether this ctrl+z behavior here is too strong, and maybe should only activate under more limited circumstances

@cmdcolin cmdcolin added the bug Something isn't working label Apr 12, 2023
@cmdcolin
Copy link
Collaborator Author

possible discussion of similar issue in another project WordPress/gutenberg#18755

@rbuels
Copy link
Contributor

rbuels commented Apr 14, 2023 via email

@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Apr 14, 2023

i'm not sure if there another way but "capturing" would seem to mean stopPropagation on all undo/redo type key strokes(?) on all text fields, and thus puts the "onus" of doing that on all text fields, which seems a bit odd

@rbuels
Copy link
Contributor

rbuels commented Apr 14, 2023

But looking at it another way: what should happen when hitting ctrl-z in a text field? I think the text field should do an undo. Maybe there is a non-repetitive way to make all our text fields capture ctrl-z.

@rbuels
Copy link
Contributor

rbuels commented Apr 14, 2023

But also, you're right, having ctrl-z undo a whole view action might be a bit much, a user could be surprised that it happened. Maybe have a confirmation dialog? Or maybe ctrl-z wouldn't do top-level undoing?

@rbuels rbuels changed the title Ctrl+z behavior inside textfield Ctrl+z inside textfield does (unexpected?) top-level undo on the state tree Apr 14, 2023
@cmdcolin
Copy link
Collaborator Author

one possible thing for this would be to not use ctrl+z for our undo, but rather some other keycode that doesn't overlap with the browser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants