-
Notifications
You must be signed in to change notification settings - Fork 21
Always return tooltip text, then users could use their own code to fine tune tooltips #20
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
Conversation
Maybe we should give some context, it's go-gitea/gitea#23461 (comment) and my comments below. |
@silverwind thank you for your hint. @wxiaoguang, I considered to speed up the lib in general at first by moving tooltip generation and tippy initialization towards mouseover events. As next: I think about making tippy.js optional and add an event (f.e. 'showTooltip') plus the current tooltip method so people can choose whatever they want. |
If I understand correctly, tippy uses I have tried an approach and it works: function lazyTooltipOnMouseEnter(e) {
e.target.removeEventListener('mouseenter', lazyTooltipOnMouseEnter, true);
// create the tippy
}
el.addEventListener('mouseenter', lazyTooltipOnMouseEnter, true); // and `focus` event, if necessary. Using |
I forgot to mention, that The magic happens here:
and here: vue3-calendar-heatmap/src/components/CalendarHeatmap.vue Lines 287 to 317 in b71c195
If you have a better approach or suggestions, your feedback is welcome! :) |
Awesome! I think this PR could be closed, thank you very much. |
|
Creating a lot of tippy instances is expensive.
I think CalendarHeatmap could always provide the tooltip content by
data-tippy-content
(even iftooltip=false
), then users could use their own code to fine tune tooltips.Thank you very much!
ps: diff with ignoring space looks clearer 😁