-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Handle isDraft or isInvalid Enter keypress via onKeyDown instead of a Keyboard Shortcut #51021
Conversation
…f keyboard shortcut
Size Change: -19 B (0%) Total Size: 1.39 MB
ℹ️ View Unchanged
|
Flaky tests detected in 2df95a3. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5094958497
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the enter
keypress issue. Looks good to me 👍
…f keyboard shortcut (WordPress#51021)
What?
Removes the Keyboard Shortcut for
enter
and relies on theonKeyDown
event.Why?
Having a Keyboard Shortcut for
enter
, meant that it captured allenter
keypresses when a draft or invalid link was on the editor, breakingenter
keypresses for anything else on the editor, even outside of the iframed editor pane in the site editor.How?
Remove the Keyboard Shortcut and add conditions to the existing
onKeyDown
event. I would have used theonClick
event, but it wasn't working. I feel like it should work withonClick
, but this implementation is clearly better for now since it doesn't breakenter
keypresses across the app when there's a draft post in a navigation block.Testing Instructions for Keyboard