Skip to content

[Tooltip] Close Tooltip when its child becomes disabled#44507

Merged
mj12albert merged 5 commits into
mui:masterfrom
chudesno:tooltip-persists-when-its-child-becomes-disabled
Apr 23, 2026
Merged

[Tooltip] Close Tooltip when its child becomes disabled#44507
mj12albert merged 5 commits into
mui:masterfrom
chudesno:tooltip-persists-when-its-child-becomes-disabled

Conversation

@chudesno
Copy link
Copy Markdown
Contributor

@chudesno chudesno commented Nov 21, 2024

This PR handles blurring of a child element when it is getting disabled.
React does not fire blur event in such case, so we resort to using native blur event instead.
facebook/react#9142

Fixes #44280

After fix: https://codesandbox.io/p/sandbox/material-ui-cra-ts-forked-2fskvz?file=%2Fsrc%2FApp.tsx%3A5%2C51

@mui-bot
Copy link
Copy Markdown

mui-bot commented Nov 21, 2024

Netlify deploy preview

https://deploy-preview-44507--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against c9f8f25

@chudesno chudesno force-pushed the tooltip-persists-when-its-child-becomes-disabled branch from 0b61f7e to c9f8f25 Compare November 22, 2024 00:02
@zannager zannager added the component: Toolbar The React component. label Nov 25, 2024
Copy link
Copy Markdown
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works as shown in the "After fix" CodeSandbox linked in the description, but since it's a workaround, I believe it should be fixed in React.

@ZeeshanTamboli ZeeshanTamboli added type: bug It doesn't behave as expected. scope: tooltip Changes related to the tooltip. package: material-ui and removed component: Toolbar The React component. labels Nov 28, 2024
@oliviertassinari
Copy link
Copy Markdown
Member

oliviertassinari commented Nov 28, 2024

For all of those component bug fixes, that are not design related, how about we move with a policy that has:

  1. Priority number one is to see how Base UI is impacted
  2. Priority number two is to fix Base UI if impacted
  3. And maybe we fix the legacy version of the components in Material UI (here). Material UI is getting rewritten from scratch, so anything we fix here is mostly only valuable for it's tests (that should be moved over to Base UI)

?

@oliviertassinari oliviertassinari changed the title [material-ui][Tooltip] Hide Tooltip when its child gets disabled (#44… [Tooltip] Hide Tooltip when its child gets disabled Nov 28, 2024
@oliviertassinari oliviertassinari added the on hold There is a blocker, we need to wait. label Nov 28, 2024
@chudesno
Copy link
Copy Markdown
Contributor Author

It appears that Base UI is affected as well in a similar way.
Reported there under mui/base-ui#891

@mj12albert mj12albert force-pushed the tooltip-persists-when-its-child-becomes-disabled branch from c9f8f25 to 499bc06 Compare April 22, 2026 23:38
@mj12albert mj12albert removed the on hold There is a blocker, we need to wait. label Apr 22, 2026
@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented Apr 22, 2026

Bundle size

Bundle Parsed size Gzip size
@mui/material 🔺+125B(+0.02%) 🔺+38B(+0.03%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Deploy preview

https://deploy-preview-44507--material-ui.netlify.app/


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

@mj12albert mj12albert force-pushed the tooltip-persists-when-its-child-becomes-disabled branch 2 times, most recently from b0538b5 to 9504754 Compare April 23, 2026 08:09
@mj12albert mj12albert changed the title [Tooltip] Hide Tooltip when its child gets disabled [Tooltip] Close Tooltip when its child becomes disabled Apr 23, 2026
@mj12albert
Copy link
Copy Markdown
Member

@mj12albert mj12albert force-pushed the tooltip-persists-when-its-child-becomes-disabled branch from af31d24 to db7237f Compare April 23, 2026 08:44
Copy link
Copy Markdown
Member

@mj12albert mj12albert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @chudesno

@mj12albert mj12albert enabled auto-merge (squash) April 23, 2026 09:56
@mj12albert mj12albert merged commit 2bbacae into mui:master Apr 23, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: tooltip Changes related to the tooltip. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[tooltip] Tooltip persists when its child becomes disabled

6 participants