Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/data/material/components/tooltips/DisabledTooltips.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import Tooltip from '@mui/material/Tooltip';
export default function DisabledTooltips() {
return (
<Tooltip describeChild title="You don't have permission to do this">
<span>
<Button disabled>A Disabled Button</Button>
</span>
<Button disabled style={{ pointerEvents: 'auto' }}>
A Disabled Button
</Button>
</Tooltip>
);
}
6 changes: 3 additions & 3 deletions docs/data/material/components/tooltips/DisabledTooltips.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import Tooltip from '@mui/material/Tooltip';
export default function DisabledTooltips() {
return (
<Tooltip describeChild title="You don't have permission to do this">
<span>
<Button disabled>A Disabled Button</Button>
</span>
<Button disabled style={{ pointerEvents: 'auto' }}>
A Disabled Button
</Button>
</Tooltip>
);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Tooltip describeChild title="You don't have permission to do this">
<span>
<Button disabled>A Disabled Button</Button>
</span>
<Button disabled style={{ pointerEvents: 'auto' }}>

@mayank99 mayank99 Jun 4, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This isn't working anymore. It was working when I last tested it in 9.0.1: https://stackblitz.com/edit/sjet9vpm?file=src%2FDemo.tsx.

This change from #48606 is the likely cause:

const handleMouseOver = (event) => {
if (childNode?.disabled) {
return;
}

A Disabled Button
</Button>
</Tooltip>
18 changes: 2 additions & 16 deletions docs/data/material/components/tooltips/tooltips.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,28 +147,14 @@ You can disable this behavior (thus failing the success criterion which is requi

## Disabled elements

By default disabled elements like `<button>` do not trigger user interactions so a `Tooltip` will not activate on normal events like hover. To accommodate disabled elements, add a simple wrapper element, such as a `span`.

:::warning
In order to work with Safari, you need at least one display block or flex item below the tooltip wrapper.
:::
When wrapping a Material UI component that inherits from `ButtonBase`, you should add the CSS property _pointer-events: auto;_ to your element when disabled:

{{"demo": "DisabledTooltips.js"}}

:::warning
If you're not wrapping a Material UI component that inherits from `ButtonBase`, for instance, a native `<button>` element, you should also add the CSS property _pointer-events: none;_ to your element when disabled:
By default, disabled elements like `<button>` are not keyboard focusable, so a `Tooltip` will only work for mouse users.
:::

```jsx
<Tooltip describeChild title="You don't have permission to do this">
<span>
<button disabled={disabled} style={disabled ? { pointerEvents: 'none' } : {}}>
A disabled button
</button>
</span>
</Tooltip>
```

## Transitions

Use `slots.transition` and `slotProps.transition` to use a different transition.
Expand Down
Loading