tippyjs-react
tippyjs-react copied to clipboard
Using Tippy with custom hover logic
I'm using Tippy for showing a profile card when hovering on a user name:
const ProfilePopup = (props: User["profile"]) => {
const [source, target] = useSingleton({
overrides: ["placement"],
});
return (
<>
<Tippy singleton={source} delay={100} />
<Tippy
content={
<Content {...props.user.profile} />
}
singleton={target}
placement="left-end"
>
{props.user.name}
</Tippy>
</>
);
}
This snippet works great when I'm hovering a cursor over a user name But disappears (kind of expected) when I move a cursor to the tooltip itself where I have some buttons
Is it possible to set up Tippy to trigger close() only when going outside of Tippy itself and <Content />?
<Tippy singleton={source} delay={100} interactive />
Thanks! A bit confused since I was adding interactive to the second Tippy instance
Is it intentionally not working when properties are provided to the second one?