-
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
Keycodes: Test modifiers for keyboard event as exclusive set #20733
Conversation
Size Change: +32 B (0%) Total Size: 842 kB
ℹ️ View Unchanged
|
@rgembalik If you're willing, could you test to see if this fixes the issue you described in #17870? You can test it at: http://gutenberg.run/20733 |
@aduth Thanks for letting me know. I haven't tested the issue on exactly the same environment before (Gutenberg.run), but I can confirm, that under the environment you sent me it all works as expected for Chrome, Edge and IE11. |
3f88808
to
76f140f
Compare
Fixes #17870
This pull request seeks to improve the logic for
@wordpress/keycodes
isKeyboardEvent
to test expected modifiers as exclusively the same as those reported by the given event. See the test case added in 3f88808 as an example of a result which would previously have returnedtrue
forisKeyboardEvent.primary
with a key event for CtrlShiftm.Also included are updates to test cases of non-
primary
modifiers, where previously the tests were always asserting against the result ofisKeyboardEvent.primary
. See 05bd721 for specific changes. Notably, the tests foraccess
expected modifiers were inconsistent with the actual implementation and needed to be updated. I deferred to the current implementation as the "expected" result, though I am not entirely clear what an "access" modifier is, so I'd appreciate a second set of eyes.Testing Instructions:
Ensure unit tests pass:
Repeat Steps to Reproduce from #17870, ensuring that the Ctrl+A "Select All" behavior is not triggered in response to a AltGrA key combination.