-
Notifications
You must be signed in to change notification settings - Fork 21
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
DP-23086 A11y when org search is not shown, it should be fully hidden for all users #1531
base: develop
Are you sure you want to change the base?
DP-23086 A11y when org search is not shown, it should be fully hidden for all users #1531
Conversation
… instead heading for interation
…tps://github.com/massgov/mayflower into patternlab/DP-23086_organization-search-keyboard
So, I fixed the keyboard focus trapping issue:The sub nav part was more involved:
|
} | ||
// Capture click, spacebar and enter keys. | ||
$mobileToggle.keypress(function() { | ||
if (event.which == 13 || event.which == 32) mobileToggleClick(); |
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.
.which
is deprecated and don't support IE11, please use KeyboardEvent.key and KeyboardEvent.code for new code.
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, I just updated this.
} | ||
|
||
// Capture click, spacebar and enter keys. | ||
$mobileToggle.keypress(function(e) { |
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.
$mobileToggle.keypress(function(e) { | |
$mobileToggle.keypress(function(event) { |
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.
I changed it with keyboardEvent
packages/patternlab/styleguide/source/assets/js/modules/organizationNavigation.js
Outdated
Show resolved
Hide resolved
$button.on('focus', function () { | ||
$thisMenu.find("a[href]").attr("tabindex", -1); | ||
$otherMenus.find("a[href]").attr("tabindex", -1); | ||
// $button.on('focus', function () { |
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.
This is the commented code I mentioned above
…zationNavigation.js Co-authored-by: Minghua Sun <[email protected]>
|
||
$('.item-open').removeClass('item-open'); | ||
// TO DO: Close mobile menu container. |
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.
Note for TO DO:
This is tricky one. It's meant to close the mobile menu container, which is different from one above. The one above at L. 182 closes an open submenu. Based on the way the mobile nav works, this is triggered when submenus are closed, which means one of the navigation buttons/links or the search is supposed to have focus. If you just check if the mobile container is open for the trigger, the condition also applies to L. 182.
@Javi-er I merged my changes into your branch. Template + CSS
JS
Here is the to-do list. At the point my changes were merged, I did some quick testing with keyboard and screen readers. Items listed at the fix are not working as expected. Not sure if they are syntax or jQuery issues or something else. TO DOs
|
Any PRs being created needs a changelog.txt file before being merged into dev. See: Change Log Instructions
Description
Hides the search form so it's not focusable by the keyboard instead of using just opacity.
Related Issue / Ticket
Steps to Test
Screenshots
Use something like licecap to capture gifs to demonstrate behaviors.
Additional Notes:
Anything else to add?
Impacted Areas in Application
@todo
Today I learned...