-
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
UnitControl: Fix an issue where keyboard shortcuts unintentionally shift focus on Windows OS #62988
Conversation
…ift focus on Windows OS
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @webexpr-dhenriet. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Flaky tests detected in cbe9098. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9721840478
|
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.
LGTM, thanks @t-hamano 🙌
I'd only update the inline comment above your change before shipping.
Otherwise, ready to 🚀
@@ -172,6 +172,7 @@ function UnforwardedUnitControl( | |||
// matches the first character of a unit. | |||
if ( | |||
! event.metaKey && | |||
! event.ctrlKey && |
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.
Let's also update the comment above (to reference the ctrl
key in addition to the meta
key).
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.
Thanks for the review! Updated by b90cc5a
…ift focus on Windows OS (WordPress#62988) * UnitControl: Fix an issue where keyboard shortcuts unintentionally shift focus on Windows OS * Update changelog * Update comment Unlinked contributors: webexpr-dhenriet. Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org>
Follow-up #39303
Fixes #62967
What?
This PR fixes an issue where the focus unintentionally moves to the unit when executing the paste shortcut (
Ctrl+V
) in an input field on Windows OS.Why?
Only
event.metaKey
is checked to give focus to the unit, which may work on MacOS, but on Windows OS theCtrl
key isevent.ctrlKey
.Testing Instructions
The following are test procedures for Windows OS, but they should continue to work as expected on MacOS.
localhost:50240/?path=/docs/components-experimental-unitcontrol--docs
Ctrl+V
in the input field.p
,v
ore
key.Screenshots or screencast
After.mp4