Keycodes: Test modifiers for keyboard event as exclusive set#20733
Merged
Keycodes: Test modifiers for keyboard event as exclusive set#20733
Conversation
|
Size Change: +32 B (0%) Total Size: 842 kB
ℹ️ View Unchanged
|
Member
Author
|
@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. |
gziolo
approved these changes
Apr 16, 2020
3f88808 to
76f140f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #17870
This pull request seeks to improve the logic for
@wordpress/keycodesisKeyboardEventto 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 returnedtrueforisKeyboardEvent.primarywith a key event for CtrlShiftm.Also included are updates to test cases of non-
primarymodifiers, where previously the tests were always asserting against the result ofisKeyboardEvent.primary. See 05bd721 for specific changes. Notably, the tests foraccessexpected 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.