You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[tooltip] Add a way to prevent closing a tooltip on click #4113
I would expect to be able to do that with Base UI given how flexible it is, and indeed it is possible to control the open prop and ignore onOpenChange events when the reason for the change is 'trigger-press', but it is not perfect* and I ultimately believe it would be better to officially support this use case with a preventCloseOnClick boolean prop or something.
*Check it out here, and watch the following video that shows 2 issues with this solution which I haven't figured out how to cleanly fix:
When clicking and then moving the cursor away, the tooltip shows instantly when the cursor re-enters the trigger, instead of waiting for the configured delay. Note: this is actually a "regression" in version 1.2.0 (potentially introduced in [tooltip] Fix disabled prop on Triggers #4049?); it didn't occur in version 1.1.0 but since this use case is not documented, I don't know if it would count as a bug...
When clicking the trigger before the tooltip has a chance to appear (before the delay), the tooltip just never appears. This can be worked around by setting a timeout that opens the tooltip in the !newOpen && eventDetails.reason === 'trigger-press' branch (and clearing it if onOpenChange is called again before it runs), but it feels pretty fragile, and still not perfect.
CleanShot.2026-02-16.at.13.59.19.mp4
Examples in other libraries
Dunno.
Motivation
The designer in my team wants our Tooltip component to remain open even after clicking the button it's attached to. This sort of makes sense to me for many use cases, like buttons that you can click multiple times (toggle or increment/decrement) or buttons that have a tooltip whose content changes on click ("Copy" => "Copied").
buttons that have a tooltip whose content changes on click ("Copy" => "Copied").
I'm guessing that the majority of the motivation for this change comes from a misunderstanding of this pattern? As James pointed to, the "Copied' text is actually a Toast, it's not a tooltip. Just keeping the tooltip open here wouldn't communicate the outcome to SR users, or the other benefits that Toast provides.
I'm wondering, given that use case is already solved via anchored toasts, how strong is the desire for this? I struggle to think of a UI that would be improved by keeping the tooltip open after click.
Icons for Bold, Italic, Underline, Copy etc. are all extremely common universal, and always appear in specific contexts (above a rich text editor, or inside/above a code block) that strengthen the association. So there is actually no strong need for a tooltip in these cases at all. But you can include one anyway, it might help a for some tiny portion of users who don't understand the Bold icon.
But even then, you see the tooltip once, and read it. Then you click the button and the selected text changes. By this point, you have had 3 very strong indicators (the universal icon, the tooltip you read, and the action the button performed) for what the button does, that there is simply no need at all for the tooltip anymore, right?
This is not a breaking change, and it can be argued that therefore it doesn't really matter. But in the interest of avoiding API bloat creeping over time, I want to question this. It strikes me as a bad idea.
Thanks for the thoughts @colmtuite (BTW I think some of your own words ended up in that quote at the start of your message). I actually don't have a strong opinion on this at all, but I believe the designer I'm working with does, so I'll point him to this thread.
Activity
linear commentedon Feb 16, 2026
BAS-394
atomiks commentedon Feb 17, 2026
This use case should be solved by anchored toasts
But this feature/prop seems like valid in general, especially for a use case like this:
#3782
fix(clipboard-text): use Popover for tooltip to prevent flicker on click
colmtuite commentedon Feb 20, 2026
I'm guessing that the majority of the motivation for this change comes from a misunderstanding of this pattern? As James pointed to, the "Copied' text is actually a Toast, it's not a tooltip. Just keeping the tooltip open here wouldn't communicate the outcome to SR users, or the other benefits that Toast provides.
I'm wondering, given that use case is already solved via anchored toasts, how strong is the desire for this? I struggle to think of a UI that would be improved by keeping the tooltip open after click.
Icons for Bold, Italic, Underline, Copy etc. are all extremely common universal, and always appear in specific contexts (above a rich text editor, or inside/above a code block) that strengthen the association. So there is actually no strong need for a tooltip in these cases at all. But you can include one anyway, it might help a for some tiny portion of users who don't understand the Bold icon.
But even then, you see the tooltip once, and read it. Then you click the button and the selected text changes. By this point, you have had 3 very strong indicators (the universal icon, the tooltip you read, and the action the button performed) for what the button does, that there is simply no need at all for the tooltip anymore, right?
This is not a breaking change, and it can be argued that therefore it doesn't really matter. But in the interest of avoiding API bloat creeping over time, I want to question this. It strikes me as a bad idea.
benface commentedon Feb 20, 2026
Thanks for the thoughts @colmtuite (BTW I think some of your own words ended up in that quote at the start of your message). I actually don't have a strong opinion on this at all, but I believe the designer I'm working with does, so I'll point him to this thread.
colmtuite commentedon Feb 23, 2026
We're gonna go ahead with this
github-actions commentedon Mar 2, 2026
This feature will be available in the next npm release of Base UI.
In the meantime, you can try it out on our Canary release channel: