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

Fix undo/redo keyboard shortcut #361

Merged
merged 1 commit into from
Jan 2, 2025
Merged

Conversation

slimbuck
Copy link
Member

Fixes #232

This PR adds an option to register a keyboard event for capture phase (instead of the default bubble phase). Capture phase handlers are fired first, before any child listeners, allowing global overrides of events.

This is useful for undo/redo which is also handled by entry boxes and results in confusing undo/redo behaviour depending on the currently focused dom element.

This PR also stops propagation of the recognised up and down events and also prevents the default event firing. This is required for capture phase handler, but is probably also desirable for bubble events. This change needs testing.

@slimbuck slimbuck added the bug Something isn't working label Dec 30, 2024
@slimbuck slimbuck requested a review from a team December 30, 2024 14:19
@slimbuck slimbuck self-assigned this Dec 30, 2024
@slimbuck slimbuck changed the title Fix undo/redo shortcut Fix undo/redo keyboard shortcut Jan 2, 2025
@slimbuck slimbuck merged commit d1cab3e into playcanvas:main Jan 2, 2025
2 checks passed
@slimbuck slimbuck deleted the undo-fix branch January 2, 2025 09:57
@simonbethke
Copy link
Contributor

Has this already been released? I ran into random UNDO-issues yesterday.

@willeastcott
Copy link
Contributor

@simonbethke No, I believe we are aiming to deploy the fix either today or tomorrow.

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 this pull request may close these issues.

Undo/Redo causes unwanted rotation
3 participants