Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide MDL tooltip with javascript

When I click on my MDL save button I am disabling the button. However, the tooltip gets stuck below it when the button gets disabled. Is there a way to hide the MDL tooltip with code?

<mdl.Button id="save1_Button" buttonType="mini-fab" buttonColor="primary" disabled={true}>Save</mdl.Button>
<div className="mdl-tooltip" htmlFor="save1_Button">
   Save
</div>
like image 744
Lambert Avatar asked Apr 02 '26 07:04

Lambert


1 Answers

It's a hack, but you can do it with:

$('.mdl-tooltip.is-active').removeClass('is-active');

I know, this is just a workaround, but I couldn't find a supported way of doing it.

like image 200
Pekastel Avatar answered Apr 04 '26 14:04

Pekastel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!