atomiks / tippyjs

Tooltip, popover, dropdown, and menu library
https://atomiks.github.io/tippyjs/
MIT License
11.91k stars 518 forks source link

With 'manual' trigger,tippy does not call "onHidden" when "show" is called successive two times. #1000

Open chunyisong opened 2 years ago

chunyisong commented 2 years ago

Bug description

With 'manual' trigger,tippy does not call "onHidden" when "show" is called successive two times.

Reproduction

Click the ShowTippy button in the demo below once,then click it again can not see the log from onHidden. If click other place but the button then the tippy hide and "onHidden" is called.

https://codepen.io/happy999/pen/vYJjKEB

atomiks commented 2 years ago

onHidden is only called once the tippy has fully hidden/unmounted. When clicking again this doesn't happen, so it seems correct? If you mousedown, without mouseup, you can see it gets unmounted once the transition completes, and logs out.

chunyisong commented 2 years ago

onHidden is only called once the tippy has fully hidden/unmounted. When clicking again this doesn't happen, so it seems correct? If you mousedown, without mouseup, you can see it gets unmounted once the transition completes, and logs out.

Thanks! I trid to call "hide()" before "show()" but the "onHidden" still is not called. Is there a "onUnmounted" ? Or other way to hook to have chance like onHidden? I really want to know the state change whenever hide-action already executed.