Skip to content

[tooltip] Add a way to prevent closing a tooltip on click #4113

Description

@benface

Feature request

Summary

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:

  1. 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...
  2. 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").

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: tooltipChanges related to the tooltip component.type: new featureExpand the scope of the product to solve a new problem.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions