Skip to content

[tooltip] Prevent stuck-open tooltip when child becomes disabled#48606

Merged
Janpot merged 1 commit into
mui:masterfrom
Janpot:fix/tooltip-disabled-stuck-open
Jun 2, 2026
Merged

[tooltip] Prevent stuck-open tooltip when child becomes disabled#48606
Janpot merged 1 commit into
mui:masterfrom
Janpot:fix/tooltip-disabled-stuck-open

Conversation

@Janpot
Copy link
Copy Markdown
Member

@Janpot Janpot commented Jun 1, 2026

This surfaced as a flaky test_browser_legacy failure of <Tooltip /> > focus > closes when the focused child becomes disabled.

When a focused Tooltip child becomes disabled, the close is scheduled through the React #9142 native-blur workaround. The layout shift from disabling the anchor (and repositioning the interactive popper) can make the browser dispatch a stray mouseover on the popper, which cancelled the pending close (leaveTimer.clear() in handleMouseOver) and re-opened the tooltip — leaving it stuck open.

handleMouseOver now ignores events while the anchor is disabled, so a disabled anchor can't (re)open its tooltip. Adds a deterministic regression test that dispatches the stray mouseover within a leaveDelay window.

@Janpot Janpot marked this pull request as draft June 1, 2026 17:29
@Janpot Janpot added the scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). label Jun 1, 2026
@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented Jun 1, 2026

Deploy preview

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

Bundle size

Bundle Parsed size Gzip size
@mui/material 🔺+13B(0.00%) 🔺+4B(0.00%)
@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


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

@Janpot Janpot force-pushed the fix/tooltip-disabled-stuck-open branch from bdf9be6 to 7cae860 Compare June 1, 2026 17:31
@Janpot Janpot added scope: tooltip Changes related to the tooltip. and removed scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). labels Jun 1, 2026
@Janpot Janpot marked this pull request as ready for review June 1, 2026 17:42
@Janpot Janpot requested a review from a team June 2, 2026 07:32
@Janpot Janpot merged commit b3a565e into mui:master Jun 2, 2026
20 checks passed
@oliviertassinari oliviertassinari changed the title [Tooltip] Prevent stuck-open tooltip when child becomes disabled [tooltip] Prevent stuck-open tooltip when child becomes disabled Jun 2, 2026
@oliviertassinari oliviertassinari added the type: bug It doesn't behave as expected. label Jun 2, 2026
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.

3 participants