Skip to content

Commit

Permalink
[material-ui] Fix: [Tooltip] When wrapping an input which is disabled…
Browse files Browse the repository at this point in the history
… while focused an error is thrown mui#45373

Signed-off-by: Sarathkumar <[email protected]>
  • Loading branch information
sarathkumarsasi authored Feb 24, 2025
1 parent c3a1a8d commit 09658dd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/mui-material/src/Tooltip/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,14 +488,11 @@ const Tooltip = React.forwardRef(function Tooltip(inProps, ref) {
// Workaround for https://github.com/facebook/react/issues/7769
// The autoFocus of React might trigger the event before the componentDidMount.
// We need to account for this eventuality.
if (!event) {
return;
}
if (!childNode) {
setChildNode(event.currentTarget);
}

if (isFocusVisible(event.target)) {
if ( event && isFocusVisible(event.target)) {
setChildIsFocusVisible(true);
handleMouseOver(event);
}
Expand Down

0 comments on commit 09658dd

Please sign in to comment.