Tooltip examples are not accessible on dropdown items#7524
Tooltip examples are not accessible on dropdown items#7524tlabaj merged 3 commits intopatternfly:mainfrom
Conversation
|
Preview: https://patternfly-react-pr-7524.surge.sh A11y report: https://patternfly-react-pr-7524-a11y.surge.sh |
nicolethoen
left a comment
There was a problem hiding this comment.
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
|
|
thatblindgeye
left a comment
There was a problem hiding this comment.
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 💪🏼
| 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.
Nitpick: could this also be written as ...(this.props.role !== 'separator' && { role, ref: this.componentRef })?
thatblindgeye
left a comment
There was a problem hiding this comment.
Looks and sounds as I'd expect! Awesome work on this
jessiehuff
left a comment
There was a problem hiding this comment.
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