如何添加禁用按钮的工具提示? (反应带)

时间:2018-09-05 08:09:51

标签: web frontend markup

如何为禁用的下拉按钮添加工具提示。我使用reactstrap。

2 个答案:

答案 0 :(得分:0)

不确定下拉按钮的行为是否与常规按钮相同,对于常规按钮bur来说,是否可以将按钮包装在div中,然后将工具提示设置为以div为目标。

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

答案 1 :(得分:0)

禁用已禁用按钮上的 pointerEvents,因此您实际上是将鼠标悬停在 span 而不是按钮上:

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