Hello,
I want to use tippy with Typescript for a Tutorial with Angular 4. This is how I create my tooltip:
const element = document.querySelector("dm-assignee-selection");
const p = document.createElement("div");
p.innerText = "Hello world";
document.body.appendChild(p);
const tippy = (window as any).tippy;
const tip = tippy(element, {html: p, // OR document.querySelector('#my-template-id')
arrow: true,
animation: "fade",
hideOnClick: "persistent"});
console.log(tip);
const popper = tip.getPopperElement(element);
tip.show(popper);
The tooltip is shown. However, when I click outside of the tooltip, it disappears. However, as far as I understand persistent should prevent that. Am I doing something wrong here?
Thanks a lot,
Christian
I'm not sure what you mean. Usually 'persistent' is used for the click trigger. How can you click outside if you're hovering? Or are you referring to focus?
I see you're manually showing it. In that case, give it trigger: 'click' or trigger: 'manual' and it should work.
That is the fastest response I ever got. You're correct, trigger: "manual" fixes it. Thank you very much. :)
It would be great if the docs could be updated to note that hideOnClick: "persistent" only works if you set trigger: "manual". Took me a while to eventually figure out the combination. Thanks for Tippy!
Most helpful comment
I'm not sure what you mean. Usually
'persistent'is used for theclicktrigger. How can you click outside if you're hovering? Or are you referring tofocus?I see you're manually showing it. In that case, give it
trigger: 'click'ortrigger: 'manual'and it should work.