Tippyjs: Is there a way to handle trigger and exit without being forced to use "manual"?

Created on 28 Feb 2019  路  4Comments  路  Source: atomiks/tippyjs

How do you recommend to create a tooltip with the following:
Trigger: Hover
Exit: Click
and
Trigger: Click
Exit: Hover

Thank you!

All 4 comments

Should be possible like this

Trigger: Hover
Exit: Click

tippy('button', {
  onShow(instance) {
    instance.set({ trigger: 'click' })
  },
  onHide(instance) {
    instance.set({ trigger: tippy.defaults.trigger })
  }
})

Trigger: Click
Exit: Hover

tippy('button', {
  trigger: 'click',
  onShow(instance) {
    instance.set({ trigger: tippy.defaults.trigger })
  },
  onHide(instance) {
    instance.set({ trigger: 'click' })
  }
})

It works, thank you so much!

Did something changed? for some reason this stopped working after 4.2.1. I tried 4.3.0 and I still can't set click as trigger after tippy shows up.

Both examples still work fine for me on latest. Are you sure it's the versions and not other code?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

skazhikadyadya picture skazhikadyadya  路  3Comments

khanamiryan picture khanamiryan  路  5Comments

dpatra picture dpatra  路  4Comments

makarov906 picture makarov906  路  4Comments

mreinstein picture mreinstein  路  5Comments