If you pass { disabled: true } to SpeedDialAction ButtonProps you get a message on the console saying:
Warning: Material-UI: you are providing a disabled `button` child to the Tooltip component.
A disabled element does not fire events.
Tooltip needs to listen to the child element's events to display the title.
Place a `div` container on top of the element.
Expected behaviour: No warning.
The warning should be disabled when tooltipOpen=true, as the disabled button's events are not needed
@tasinet @JCQuintas I think that this warning should not be logged at all. I don't want to add extra complexity to avoid this error. I just want tooltip to work when button is not disabled and otherwise just don't display tooltip. Simple as that. It's expected behavior. Tooltip should just not register any events on the child when it's disabled.
I've got the same problem using Tooltip component.
As a workaround you can set title of the tooltip as empty if your element is disabled.
<Tooltip title={changed ? 'Apply changes' : ''} placement="bottom">
<Button disabled={!changed} variant="outlined" color="primary" onClick={() => myHandler()}>
My Button
</Button>
</Tooltip>
I think that even for disabled element we should show a tooltip. For example in my PHPStorm, I see tooltips for disabled buttons and it's convenient.
Most helpful comment
@tasinet @JCQuintas I think that this warning should not be logged at all. I don't want to add extra complexity to avoid this error. I just want tooltip to work when button is not disabled and otherwise just don't display tooltip. Simple as that. It's expected behavior. Tooltip should just not register any events on the child when it's disabled.