-
Notifications
You must be signed in to change notification settings - Fork 209
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
[Bug]: Memory Leak when we remove sp-tooltip(self-managed) from dom but not its parent #2359
Comments
Does it work to leverage the tooltip like this? https://studio.webcomponents.dev/edit/zig2Krhi5Ovi6vSrUMcz/src/index.ts?p=stories In your example you duplicating features of the tooltip within your implementation of the Card that you can omit all together. |
It works functionality wise but lets say we have many cards in a single page, then it will always be in the DOM for each and every card element even when its not visible thus increasing the DOM size. |
I'd love to see the stats at which point you actually see a perf drop off here. Very interesting area, but not something that benefits from optimizations that aren't supported by measurement. Regardless, the When you're ready to jump to some level of optimization, you've got a couple of options available to you:
|
Code of conduct
Impacted component(s)
sp-tooltip
Expected behavior
When client conditionally render the
sp-tooltip
, when its removed from DOM it should remove the event listener from the parent. so that when we hover on the parent the active-overlay should not be added on the DOM.See : https://studio.webcomponents.dev/edit/dcmsShnRpGqlmmaBvPWy/src/index.ts?p=stories
When the second time user hovers for 1.5secs on the card, it should look like this
Actual behavior
When the second time user hovers for 1.5secs on the card, it looks like this
Screenshots
No response
What browsers are you seeing the problem in?
Chrome, Safari
How can we reproduce this issue?
Sample code that illustrates the problem
Please check the link in expected behaviour section
Logs taken while reproducing problem
No response
The text was updated successfully, but these errors were encountered: