Skip to content
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] Fix crash when wrapping an input which becomes disabled while focused #45429

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sarathkumarsasi
Copy link

@sarathkumarsasi sarathkumarsasi commented Feb 27, 2025

Fixes #45373

… while focused an error is thrown mui#45373

Updated code based on the suggestion

Signed-off-by: Sarathkumar <[email protected]>
@mui-bot
Copy link

mui-bot commented Feb 27, 2025

Netlify deploy preview

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

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 35e60c9

@sarathkumarsasi
Copy link
Author

I have been raising a new PR since too many commits exist for the same fix. Please add identical labels of the same PR #45378, @mj12albert, @siriwatknp

@sarathkumarsasi
Copy link
Author

@mj12albert, I have made the changes you suggested and tested the code. It is working as expected. Please merge when you have time.

@mj12albert mj12albert added component: tooltip This is the name of the generic UI component, not the React module! bug 🐛 Something doesn't work package: material-ui Specific to @mui/material labels Feb 27, 2025
@mj12albert mj12albert changed the title [material-ui] Fix: [Tooltip] When wrapping an input which is disabled while focused an error is thrown mui#45373 [Tooltip] Fix crash when wrapping an input which becomes disabled while focused Feb 27, 2025
@mj12albert
Copy link
Member

since too many commits exist for the same fix

This is generally not an issue ~ we squash commits when merging anyway, or you could squash yourself: https://stackoverflow.com/questions/5189560/how-do-i-squash-my-last-n-commits-together

Copy link
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.

@sarathkumarsasi Would you mind adding a test as well?

You can use this one as a reference to start: https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Tooltip/Tooltip.test.js#L1041-L1067

Though you probably don't need to make a custom TextField, a simple setup like this should do:

render(
  <Tooltip title="test">
    <input onBlur={handleBlur} />
  </Tooltip>,
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: tooltip This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Tooltip] When wrapping an input which is disabled while focused an error is thrown
3 participants