Tooltip trigger is a sibling of the focusable element – recommended pattern? #9653
Unanswered
manisha18basra
asked this question in
Q&A
Replies: 1 comment
-
|
There's a few things to consider here. As you noted, a way to decouple focus from hover behaviour. The other, the tooltip applies accessible text to the trigger. This should be fine as Assistive Techologies and keyboard navigation would be on the hidden real trigger. Calling open/close yourself is fine, it's advanced, but it sounds like you're taking all the precautions, and since you're calling the stately methods, you'll still get the delay/warmup behaviour. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi team 👋
We’re currently using
useTooltipTriggeranduseTooltipTriggerStatefrom React Aria.We have a UI scenario where the focusable element is different from the element that visually triggers or anchors the tooltip. For example, imagine a hidden input (that receives focus) and a separate label or node next to it that should display the tooltip.
For example:
We’d like to know whether this is the recommended approach for such a pattern, or if there’s a more idiomatic way in React Aria to handle a focusable element and a separate tooltip trigger/anchor.
Current Implementation
Component Structure
Focus Tracking in Input Component
Questions
tooltipState.open()andtooltipState.close()the recommended approach for this scenario, or is there a better pattern?We’d really appreciate guidance on the intended pattern for this use case.
Thanks! 🙏
Environment:
"@react-aria/tooltip": "3.9.0""@react-stately/tooltip": "3.5.9""react": "^19.2.0"Beta Was this translation helpful? Give feedback.
All reactions