-
Notifications
You must be signed in to change notification settings - Fork 371
fix(MenuItem): mouse can trigger tooltip on aria-disabled items #11567
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
Conversation
Preview: https://patternfly-react-pr-11567.surge.sh A11y report: https://patternfly-react-pr-11567-a11y.surge.sh |
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.
One issue I'm noticing with having to pass the triggerRef to Tooltip is that removes some of the aria that Tooltip automatically sets. So currently the id
has to be manually passed to the tooltipProps
objects, and aria-describedby
would have to be manually passed to MenuItem (or dropdown or select) - but we'd also need to update some logic within these components so that aria-describedby gets set on the correct element; right now it would get set on the li
wrapper instead of the button/anchor/whatever actual menuitem.
As it is the tooltip works in getting triggered via keyboard focus or mouse hover, and the menu item itself isn't prevented from being clicked anymore, but the tooltip contents doesn't get exposed at all via VO.
My previous comment actually looks like it's a pre-existing issue. On org trying to add a tooltip to a menuitem (enabled or aria-disabled) and there's no aria attributes being applied on the |
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 good, I'll open a followup to resolve the issue of aria not being applied to the trigger within MenuItem (#11639); looks like it's due to the way Tooltip auto-applies them, it's trying to clone the children and apply the aria to it, but in the context of MenuItem the first child is a fragment. Moving the Tooltip rendering to wrap the <Component>
element in the renderItem
var looks to resolve the issue, but we should make sure nothing breaks when doing that.
Not a blocker but it did look like keeping the Tooltip wrapped around the {renderItem}
and also passing the triggerRef worked (rather than moving the Tooltip and only using triggerRef), but either way the expected aria attributes wouldn't show up.
Your changes have been released in:
Thanks for your contribution! 🎉 |
What: Closes #11358