-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(overflow-menu): accessibility navigation issues #12977
fix(overflow-menu): accessibility navigation issues #12977
Conversation
> Fix tab skip content on menu tab-out > Fix cannot navigate through OverflowMenu with arrows > Delete unused function > Small `closeMenuAndFocus` refactor Closes carbon-design-system#9471
✅ Deploy Preview for carbon-components-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
* rewrite default aria-labels to "Options" * use IconButton to display tooltip
…flow-menu-tab-navigation
…flow-menu-tab-navigation
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.
A few comments below.
I'm having a hard time figuring out how to validate this in storybook. Besides the tooltip (looks great btw!), the focus behavior seems to be the same to be between the deploy preview and prod.
What's the best way to test that the focus behavior is working correctly? Should we add another interactive element to the story to validate it moves correctly? Or is it enough to show that it moves correctly to the next focusable item outside of the storybook pane?
If my suggestion is leading to challenges, happy to discuss them. Does that give us anything? |
…nelucca/carbon into 9471-overflow-menu-tab-navigation
@mbgower would that behavior be overflowMenu only or does it also apply to iconButton? |
@tay1orjones added a button element after the overflow to make it easier to test, basically on prod tabbing out of the open menu will reset the tab order (you'll have to tab twice to get to the menu button again), in the preview you should stay at the current position |
I think it would apply to both. I can't see any reason why it wouldn't. Not only does me acting on a button with a tooltip suggest I no longer need the tooltip displayed, but what I am effectively doing by pressing that button is moving focus, right? And that should make the tooltip disappear at any rate. Screen.Recording.2023-01-25.at.2.40.16.PM.movBTW, i thought I'd just QA this by looking at Google Sheets where I know they do a lot of these tooltips on buttons (and even on other controls, such as unlabelled inputs). The action seems to make sense across all the ones where it exists. The tooltip goes away on user interaction, where opening or just acting on it. Screen.Recording.2023-01-25.at.2.43.24.PM.mov |
…flow-menu-tab-navigation
icon-button closes on click, enter or space
@mbgower does this look about right in terms of keyboard behavior and the tooltip? Should have the tooltip on IconButton as well 🙏🏻 |
Yes, the default overflow button's tooltip behaviour works well. It disappears on Esc, activation (Enter/Space) or Tab (loss of focus). Nice :) Note that in the playground, there's a focus issue when the kebab is opened (menu items not getting focus). Not relevant to the tooltip, but thought I'd point it out. |
@mbgower my bad, should be working now! |
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 looks solid to me, thanks for taking the time to iterate on this so much!
@tw15egan so that happens when |
@francinelucca hmm, that's weird; not sure why we have the @tay1orjones, any ideas? Anyways, it seems unrelated to this specific fix, so we can create a separate issue if we want to take action on it! |
I'll mention that the focus around the whole menu is not necessarily a BAD thing; it really depends on how the focus handling happens on the menu items. |
Hey there! v11.22.0 was just released that references this issue/PR. |
Closes #9471
IconButton
instead ofbutton
to automatically display tooltipChangelog
Changed
closeMenuAndFocus
refactorariaLabel
andiconDescription
props to "Options"button
element with anIconButton
to display tooltipcloseOnActivation
optional prop to tooltipIconButton
to close tooltip on button activationBreadcrumb
's styling (accounting for new tooltip) when using overflowmenuRemoved
handleKeyDown
functionTesting / Reviewing
On local OverflowMenu SB:
Review/Take into consideration:
closeOnActivation
prop for tooltip and got a warning about semver, is there something else I need to do or is this ok?span
to cover for the new tooltip behaviorTODO: