Skip to content

[tooltip] Add closeOnClick prop - #4140

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

atomiks merged 4 commits into
mui:masterfrom
atomiks:codex/tooltip-trigger-close-on-click

Conversation

@atomiks

@atomiks atomiks commented Feb 19, 2026 •

Copy link
Copy Markdown
Contributor

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

pkg-pr-new Bot commented Feb 19, 2026 •

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/@base-ui/react@4140
    
    pnpm add https://pkg.pr.new/@base-ui/utils@4140
    

commit: 10ccd99

@netlify

netlify Bot commented Feb 19, 2026 •

Copy link
Copy Markdown

✅ 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

mui-bot commented Feb 19, 2026 •

Copy link
Copy Markdown

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
Copy Markdown
Contributor

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

@atomiks

atomiks commented Feb 21, 2026

Copy link
Copy Markdown
Contributor Author

@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
5 of 6 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