-
-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Tooltip] Hide Tooltip when its child gets disabled #891
Comments
The pull request for Material UI has been put on hold in favor of Base UI: mui/material-ui#44507 |
@chudesno I'm afraid your sandbox is crashing 😐 <React.StrictMode>
<Demo />
<Demo />
<AnchorButton>FFF</AnchorButton>
</React.StrictMode> |
My bad! Sandbox is fixed now. @mj12albert please, take another look |
Maybe it should close as soon it becomes disabled? 🤔 |
Yes, absolutely. What I meant here is that blur gets fired by browser when button gets disabled and the focus moves to body. |
The focus on becoming disabled seems odd/unnecessary here? Tooltip should close when the button is activated by any means, right @atomiks? Currently, it closes when you click or press ESC, but not when you activate the button via Space or Enter. |
If |
Is there any update on this? |
@TheOneTheOnlyJJ the issue is largely resolved in the latest versions of Base UI for button triggers as a result of the linked PR above (floating-ui/floating-ui#3145) https://codesandbox.io/p/sandbox/priceless-resonance-6xmhjr When pressing Enter/Space the tooltip disappears. It doesn't address the edge case above (#891 (comment)) but I figure that's quite a bit rarer. |
Would you happen to have a rough idea of when it will land in Material UI? I opened mui/material-ui#44280 some 4 months ago, and it seems like it was fixed given what I'm reading here, but I still have the same issue. |
Steps to reproduce
Steps:
Current behavior
Tooltip remains visible until another button within the same Provider gets focused.
Expected behavior
Tooltip should get closed as soon as it becomes disabled.
Context
The original issue was spotted on Material UI and reported here mui/material-ui#44280
The root cause seems to be the React itself missing
blur
event as disable flag gets set by React itself. See: facebook/react#9142Your environment
npx @mui/envinfo
System:
OS: macOS 12.6.1
Binaries:
Node: 20.16.0 - ~/.nvm/versions/node/v20.16.0/bin/node
npm: 10.8.1 - ~/.nvm/versions/node/v20.16.0/bin/npm
pnpm: 9.13.2 - ~/.nvm/versions/node/v20.16.0/bin/pnpm
Browsers:
Chrome: 131.0.6778.86
Edge: 131.0.2903.70
Safari: 15.6.1
The issue is reproducible in Chrome and Safari, but not in Firefox.
Search keywords: Tooltip blur onBlur disabled
The text was updated successfully, but these errors were encountered: