tether icon indicating copy to clipboard operation
tether copied to clipboard

`destroy` only removing `zeroElement`

Open danoc opened this issue 8 years ago • 1 comments

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?

danoc avatar Jan 07 '17 00:01 danoc

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

Maximaximum avatar Oct 11 '17 17:10 Maximaximum