Support informational tooltips on non-interactive elements #8471
-
Hi! I'm trying to show an informational tooltip on hover for a non-interactive element. It seems this isn't currently possible, so I ended up wrapping the element in a
This results in the warning: Is there a recommended way to display informational tooltips on non-interactive elements with React Aria? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Putting tooltips on non-interactive elements is intentionally not supported due to not being accessible. For React Spectrum, we use the ContextualHelp component to add context as to why something is disabled: |
Beta Was this translation helpful? Give feedback.
-
Thank you for the answer! ContextualHelp doesn't quite fit in my case. I'm trying to show a tooltip for a read-only value (e.g. the current cursor column in a text editor) it's not disabled, just not interactive. |
Beta Was this translation helpful? Give feedback.
Yeah, this isn't something we support since it won't be accessible to keyboard, touch, or screen reader users, so I would recommend Focusable for this use case.