How to enable Bootstrap tooltip on disabled button?

后端 未结 18 2455
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-28 23:18

I need to display a tooltip on a disabled button and remove it on an enabled button. Currently, it works in reverse.

What is the best way to invert this behaviour?

18条回答
  •  粉色の甜心
    2020-11-28 23:50

    This can be done via CSS. The "pointer-events" property is what's preventing the tooltip from appearing. You can get disabled buttons to display tooltip by overriding the "pointer-events" property set by bootstrap.

    .btn.disabled {
        pointer-events: auto;
    }
    

提交回复
热议问题