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

Don't remove inline styles when destroying popper instance #1179

Closed
vincerubinetti opened this issue Oct 8, 2020 · 1 comment
Closed

Don't remove inline styles when destroying popper instance #1179

vincerubinetti opened this issue Oct 8, 2020 · 1 comment
Labels
feature This would be nice to have. NEEDS: triage

Comments

@vincerubinetti
Copy link

Feature description

Currently, when calling popperInstance.destroy(), not only does the instance get destroyed, but the computed position held in the tooltip inline styles is removed. Here's why I don't want that to happen.

When I call destroy, I want the popper instance to stop listening to resize/scroll events and recomputing the tooltip position frequently, but I want the last computed position to remain so I can perform a fade-out CSS animation. I have a work around, but it is silly:

const style = tooltip.getAttribute("style");
if (popper)
  popper.destroy();
tooltip.style = style;

Also, it would really be good to add destroy to the docs, as it currently is only mentioned in passing in the example.

Why should this feature be part of the Popper's core?

I feel like this should probably be easy to implement as an option to destroy(), and could be useful to people.

@vincerubinetti vincerubinetti added feature This would be nice to have. NEEDS: triage labels Oct 8, 2020
@FezVrasta
Copy link
Member

What you could do is to disable the event listeners (set the eventListeners modifier enabled flag to falase), fade the tooltip out, and then destroy the instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This would be nice to have. NEEDS: triage
Projects
None yet
Development

No branches or pull requests

2 participants