-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
[Tooltip] Lazy floating UI/don't execute any floating UI logic until mouse over on uncontrolled variant. #1539
Comments
Hi @sunwrobert the expensive anchor positioning work isn't active until a tooltip is hovered/mounted to the DOM, so that shouldn't be a concern. There's other stuff executed in the root on mount before hovering (e.g. effects), and maybe work related to |
This is what I see right when reloading the page with profile enabled and this is the gist of our Tooltip code.
|
Hmm, related to If you install the latest version to update your lockfile (them remove), it will pull in those changes
|
Looks promising, will try it out ty |
Hey @atomiks, just updated to the latest version and I don't see the floating-ui code being hit anymore which is pretty nice. Still noticing this hook being called though from base-ui itself. This happens after page load (haven't interacted with any elements). Is this intentional/unavoidable? |
A bunch of hooks are called in the root where it's unavoidable, that's one of them. That particular hook should be cheap though - is it executing the returned function on mount and causing an issue? |
Yeah seems to be executing on mount |
Feature request
Summary
Our website uses a ton of Tooltips, and using the profiler, seems that a decent amount of time is spent hitting floating-ui code even if the user hasn't interacted with the site or hovered anything. I'm wondering if it makes sense for the tooltip to have some prop that defers any floating UI logic until interaction? Of course, I could do this manually with a Controlled Tooltip but wondering if this would be beneficial as part of the library. Thanks!
Examples in other libraries
Motivation
The text was updated successfully, but these errors were encountered: