-
Notifications
You must be signed in to change notification settings - Fork 377
feat(PF4-Dropdown): Enhance keyboard interaction for a11y #815
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
feat(PF4-Dropdown): Enhance keyboard interaction for a11y #815
Conversation
d9542a3 to
8f7f6f1
Compare
Pull Request Test Coverage Report for Build 2779
💛 - Coveralls |
- Fixes esc key interaction - Introduces focus-trap-react Fixes patternfly#557
8f7f6f1 to
27faf90
Compare
|
PatternFly-React preview: https://815-pr-patternfly-react-patternfly.surge.sh |
|
Thanks for sharing the resources you found! I tested this for the sighted keyboard-only experience, and it works as expected. There are still some updates pending in #788 that alter the screen reader experience, which is blocking me from reviewing and confirming this works as expected across all screen readers. |
| const { parentRef } = this.props; | ||
| const keyCode = event.keyCode || event.which; | ||
| if (keyCode === 27) { | ||
| if (keyCode === 27 && parentRef && parentRef.contains(event.target)) { |
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.
There is a constant for the escape key defined in the internal/constants.js can we use that here?
81d79ea
|
Deploy preview for patternfly-react-gone ready! Built with commit 81d79ea https://deploy-preview-815--patternfly-react-gone.netlify.com |
tlabaj
left a comment
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
Fixes #557
What
focus-trap-reactdependency (documentation)esckey interaction when there are multipleDropdowns on the same page. Hitting theesckey will close the menu and return focus to that particularDropdown's toggle. Previously, focus would get shifted to the lastDropdownon the screenfocus-trap-reactfocus-trap-reactwhile reading the Programmatically Managing Focus section in the React docs regarding a11yfocus-trap-reactFocus Trap Resources