Repository navigation
Should tooltip trigger on activedescendant "focus" or should I implement this manually? #2731
Replies: 1 comment
|
I would not make
The tooltip pattern, on the other hand, is triggered by actual keyboard focus or pointer hover on its trigger: https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/ Automatically combining those two concepts inside Tooltip would be surprising because:
For supplemental visual help, I would control the tooltip manually from the combobox/tag input's highlighted or active value. For information required to understand an option, I would keep it in the option's accessible name/description instead of relying on a tooltip. So my recommendation is: keep the current Tooltip focus semantics, and implement this as controlled behavior at the composite-widget level when a product explicitly wants it. |
Uh oh!
There was an error while loading. Please reload this page.
The Tooltip component shows if the trigger element gets focus or if someone hovers it, but there is another case where it's kind of a focus:
In Autocomplete, Combobox or Tags Input, you have an input element, which receives the main focus, but other elements like the options in the dropdown or tag "buttons" can be selected via arrow keys.
The browser or screen reader can be told about this via the aria-activedescendant attribute. So it's kind of a secondary focus.
Now to my question: If an option (in the combobox or the tag button gets "secondary-focused" via aria-activedescendant, should it trigger the Tooltip component if it is wrapped in one? Or should I manually implement this behavior with a controlled open state?
Also feel free to comment on the pros and cons for the UX of having a Tooltip in these places.
All reactions