Skip to content

[tooltip] Add closeOnClick prop#4140

Merged
atomiks merged 4 commits intomui:masterfrom
atomiks:codex/tooltip-trigger-close-on-click
Mar 2, 2026
Merged

[tooltip] Add closeOnClick prop#4140
atomiks merged 4 commits intomui:masterfrom
atomiks:codex/tooltip-trigger-close-on-click

Conversation

@atomiks
Copy link
Contributor

@atomiks atomiks commented Feb 19, 2026

Closes #4113

closeOnClick is true by default, but this is acceptable over false (e.g. preventCloseOnClick) if it's for consistency with other props, and closeOnClick is used elsewhere like Menu.Item

Demo: https://stackblitz.com/edit/7dzwxbku?file=src%2FApp.tsx

@atomiks atomiks added type: new feature Expand the scope of the product to solve a new problem. component: tooltip Changes related to the tooltip component. labels Feb 19, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 19, 2026

commit: 10ccd99

@netlify
Copy link

netlify bot commented Feb 19, 2026

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit f7aa5be
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69a5764a79e1170008c79f1d
😎 Deploy Preview https://deploy-preview-4140--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mui-bot
Copy link

mui-bot commented Feb 19, 2026

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+232B(+0.05%) 🔺+71B(+0.05%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@atomiks atomiks marked this pull request as ready for review February 20, 2026 04:01
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Feb 20, 2026
@colmtuite
Copy link
Contributor

I want to discuss this one more. I don't currently think it's useful for any design.

@atomiks
Copy link
Contributor Author

atomiks commented Feb 21, 2026

@colmtuite it's partially useful even for anchored toasts

It's somewhat of a micro-detail, but you don't want the tooltip to dismiss in the period between pointerdown and pointerup, so the toast appears immediately on click:

Screenshot 2026-02-21 at 6 23 54 pm

The Slider label use case is indeed questionable though — because it seems like Slider should have its own tooltip-like label part, instead of trying to reuse Tooltip (as Tooltip doesn't support touch, which is yet another config option)

# Conflicts:
#	packages/react/src/floating-ui-react/hooks/useDismiss.ts
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 2, 2026
@atomiks atomiks merged commit 0fa1337 into mui:master Mar 2, 2026
20 of 22 checks passed
@atomiks atomiks deleted the codex/tooltip-trigger-close-on-click branch March 2, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: tooltip Changes related to the tooltip component. type: new feature Expand the scope of the product to solve a new problem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants