Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep Tooltip Open when Trigger is activated via keypress and focus sent into Tooltip Content? #3246

Open
lukehathaway opened this issue Nov 21, 2024 · 1 comment

Comments

@lukehathaway
Copy link

lukehathaway commented Nov 21, 2024

Hello,

I have the following requirements for an implementation of Tooltip, and was wondering if it is possible to achieve with Radix's Tooltip:

  • Do not open the Tooltip when focused (this seems to be achievable via adding an onFocus handler to just preventDefault
  • When the user has focused the trigger, require a keypress of the Enter key in order to open the tooltip (also achievable via an onKeyUp handler
  • Once the user opens the Tooltip via keypress, send focus to the first item of content inside the tooltip. This is where I'm running into issues, because by default, once the trigger loses focus it automatically closes. I've not been able to see how I can prevent that closing of the tooltip once the tooltip is blurred.

Is it possible in a "Radix way" to keep the tooltip open in the scenario I described above?

@lukehathaway lukehathaway changed the title Setting focus to an element inside Tooltip via keypress on trigger does not render the tooltip when using open and onOpenChange Keep Tooltip Open when Trigger is activated via keypress and focus sent into Tooltip Content? Nov 22, 2024
@kotAPI
Copy link

kotAPI commented Nov 24, 2024

I think Tooltips are usually triggered automatically by mouse hovers, I think the implementation you are looking for can be covered by HoverCards (maybe you can style it like a tooltip) so you have total control over it?

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

No branches or pull requests

2 participants