KABBOUCHI / vue-tippy

VueJS Tooltip powered by Tippy.js
https://vue-tippy.netlify.app
MIT License
731 stars 89 forks source link

Hide tooltip on mouse leave #304

Closed faizaaulia closed 11 months ago

faizaaulia commented 11 months ago

Hi, if i set the trigger click, any prop/ways to hide the tooltip when I hover out/leave the reference? For now when i set the trigger click, it only can hide the tooltip when I click outside the reference.

KABBOUCHI commented 11 months ago

You can dynamically change the trigger:

<button v-tippy="{
  content: 'test',
  trigger: 'click',
  onShow({ setProps }) {
    setProps({ trigger: 'mouseenter' });
  },
  onHide({ setProps }) {
    setProps({ trigger: 'click' });
  }
}">
    Hello
</button>
faizaaulia commented 11 months ago

Great @KABBOUCHI , it works. Thank you