Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay tooltip init #280

Open
Durss opened this issue Apr 8, 2023 · 1 comment
Open

Delay tooltip init #280

Durss opened this issue Apr 8, 2023 · 1 comment

Comments

@Durss
Copy link

Durss commented Apr 8, 2023

First of all, thank you for that excellent lib <3

Now, I have a list of hundreds of images (twitch emotes) and I want to show an HD version of that image in a tooltip on hover.
It works nice but first render is drastically slowed down by tippy.

Is there any way I could delay that init or make it lighter ?
I tried using the singleton with no much success (i guess all the handlers are still created on every item)

I could build items sequentially instead of all at once but that would make a lesser UX :/
I'm using v6.

Kind regards

@Durss
Copy link
Author

Durss commented Apr 8, 2023

Okay i think i found a solution.
Always happens after asking of course. I kinda rubber ducked you sorry ahah

My solution is rather simple, on @mouseOver of the image i create the tip.
Here is a simplified example:

onHoverItem(event) {
	useTippy(event.currentTarget, {
		content: "<img src=....>",
	});
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant