Description
Provide a general summary of the issue here
We are trying to use the Tooltip to create Tags that, when hovered, show a message.
Specifically, we have Tags (TagGroup) with some text and a Remove Button.
If we remove the Button from the Tag, the Tooltip never appears, even if it's a controlled open state. This makes it impossible to use Tooltips with components that are not buttons. And specifically, react-aria-components Buttons. It doesn't work with pure HTML buttons.
Additionally, we want to place the Tooltip on top of the Tag, pointing to the exact center of the tag. However, the Tooltip is placed in reference to the Remove button of the tag instead. We can reposition it using the triggerRef, but we wonder if it's because of the first behavior that this happens.
We would appreciate any help :)
Thank you.
P.S: We are aware that interactions on hover aren't very recommended, but it's required in our use case.
🤔 Expected Behavior?
The tooltip should be usable with any component that is hoverable and focusable, and it should be placed using the whole content of the Tooltip as a reference.
😯 Current Behavior
The tooltip should does not work with any component that is hoverable and focusable, other than React Aria Button, and it is placed using the first Button inside the tooltip as a reference.
💁 Possible Solution
No response
🔦 Context
We want the Tooltip to be usable with any hoverable and focusable component, like Tags, Buttons (our own buttons), etc.
🖥️ Steps to Reproduce
- Create a component that uses TooltipTrigger, Tooltip and has a button as trigger.
- Hover over the button.
- The tooltip should appear but it doesn't.
import {Button, OverlayArrow, Tooltip, TooltipTrigger} from 'react-aria-components';
<TooltipTrigger>
<button>✏️</button>
<Tooltip>
<OverlayArrow>
<svg width={8} height={8} viewBox="0 0 8 8">
<path d="M0 0 L4 4 L8 0" />
</svg>
</OverlayArrow>
Edit
</Tooltip>
</TooltipTrigger>
Version
react-aria-components 1.1.1
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
MacOS
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response