-
Notifications
You must be signed in to change notification settings - Fork 355
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
Tooltip examples are not accessible on dropdown items #7524
Tooltip examples are not accessible on dropdown items #7524
Conversation
Preview: https://patternfly-react-pr-7524.surge.sh A11y report: https://patternfly-react-pr-7524-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.
My expectation is that the tooltip would display on VO focus just like it would on keyboard focus or mouse hover.
Here is a gif of what happens when I use a mouse to hover over an enabled dropdown item with a tooltip and a disabled item with a tooltip:
In this second recording, you'll see that the VO does not trigger the tooltip in either case until I try to click on it. When I click on the disabled dropdown item, it does finally reveal the tooltip and read it (so that's an improvement!) but I cannot trigger the tooltip on the enabled dropdown item because that also selects the item and closes the dropdown
@nicolethoen I'm noticing this behavior as well. It looks like VO is placing focus on the My previous comment about making this change here most likely wouldn't work since we'd lose the semantics of the items being menu items. |
I updated the code. Now everything should work as expected. Another solution could be
This solution should work well and it is clean. Honestly, for our menu items, I don't see the utility of announcing Another small difference: |
Going off of Valerio's comment about the utility of having "group" announced on these menu items, it does seem odd that we end up indicating to a user that they are on a menu item group that contains a single element. Some links that lean more towards Valerio's other solution of moving the
Based on these links I think I might be leaning more towards the alternative solution mentioned. |
I agree with @thatblindgeye, I think. However, I'm noticing that the Menu component uses So I think it's more in line with other solutions to do the following (if it all works with tooltips)
Other notes:
|
d43053d
to
09b61db
Compare
09b61db
to
97373cd
Compare
|
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.
Looks good! The tooltip triggers via mouse, keyboard, and with VO navigation for me, and the tooltip gets announced when triggered as well. Had a nitpick/question below, but otherwise awesome job on this 💪🏼
@@ -211,7 +211,7 @@ export class InternalDropdownItem extends React.Component<InternalDropdownItemPr | |||
...(styleChildren && { | |||
className: css(element.props.className, classes) | |||
}), | |||
...(this.props.role !== 'separator' && { ref: this.componentRef }) | |||
...(this.props.role !== 'separator' && { role } && { ref: this.componentRef }) |
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.
Nitpick: could this also be written as ...(this.props.role !== 'separator' && { role, ref: this.componentRef })
?
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.
Looks and sounds as I'd expect! Awesome work on this
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.
Looks great!
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 seems like an improvement! I hear everything announced as I would expected in VO. Out of curiosity, I tested in NVDA and JAWS as well, and I noticed that it didn't work in either of those screen readers. Since this still moves things forward, I'm wondering if it makes sense to approve this but open another issue for JAWS and NVDA? Those are pretty big screen readers that I wouldn't want to completely neglect.
Your changes have been released in:
Thanks for your contribution! 🎉 |
What: Closes #6109
it seems to work also adding the aria-labelledby prop, but the screen reader announces the tooltip before the item.
I tested the voice using the screen reader chrome plugin