Skip to content

Conversation

nicolethoen
Copy link
Contributor

What: Closes #11358

@patternfly-build
Copy link
Contributor

patternfly-build commented Feb 25, 2025

Copy link
Contributor

@thatblindgeye thatblindgeye left a 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.

@thatblindgeye
Copy link
Contributor

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 button[role="menuitem"] element. I'll try to do a little more digging on Monday, but we might be able to just open a followup for that.

Copy link
Contributor

@thatblindgeye thatblindgeye left a 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.

@thatblindgeye thatblindgeye merged commit b4c0781 into patternfly:main Mar 10, 2025
13 checks passed
@patternfly-build
Copy link
Contributor

Your changes have been released in:

Thanks for your contribution! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug - Dropdown/Select/MenuContainer - tooltips do not work by default in items

4 participants