How add tooltip for disabed button ? (reactstrap)

Viewed 2564

How add tooltip for disabled dropdown button. I use reactstrap.

2 Answers

Disable the pointerEvents on the disabled button, so you're actually hovering on span instead of buttons:

<span id="foo">
    <Button disabled style={{ pointerEvents: 'none' }}>nope!</Button>
</span>
<Tooltip target="foo" ...etc>Button is disabled</Tooltip>

Not sure if drop down buttons behave the same as regular buttons, bur for a regular button, you can wrap the button in a div, and set the tooltip to target the div.

<div id='foo'>
  <Button disabled>nope!</Button>
</div>
<Tooltip target='foo' ...etc>Button is disabled</Tooltip>
Related