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

destroy only removing zeroElement #236

Open
danoc opened this issue Jan 7, 2017 · 1 comment
Open

destroy only removing zeroElement #236

danoc opened this issue Jan 7, 2017 · 1 comment
Labels

Comments

@danoc
Copy link

danoc commented Jan 7, 2017

Hello!

I may be misunderstanding Tether.destroy, but it only removes the zeroElement and leaves the Tether.element when I call it. (The zeroElement is the first Tether-related line in this screenshot.)

screenshot 2017-01-06 15 47 46

I'm using Tether within a react component, so I'd like to remove all of the DOM nodes on componentWillUnmount.

I've worked around this by calling Tether.element.remove after destroy:

this._tether.destroy();
this._tether.element.remove();

Is this the intended behavior?

@Maximaximum
Copy link

I've spent half a day trying to figure out why my DOM keeps growing and growing by appending the same .tether-element again and again. Indeed, this should be fixed. It seems absolutely obvious that calling tether.destroy() should internally remove any elements

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

No branches or pull requests

3 participants