Skip to content

Commit

Permalink
reimplement non-conflicting fix for #53
Browse files Browse the repository at this point in the history
  • Loading branch information
mpd committed Oct 27, 2017
1 parent a7edb3c commit da97510
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/on-resize.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ const initialize = (el) => {
}
detector.destroy = () => {
if (detector.elWasStaticPosition) el.style.position = ""
// Event handlers will be automatically removed.
// http://stackoverflow.com/questions/12528049/if-a-dom-element-is-removed-are-its-listeners-also-removed-from-memory
el.removeChild(objEl)
if (el.contains(objEl)) {
// Event handlers will be automatically removed.
// http://stackoverflow.com/questions/12528049/if-a-dom-element-is-removed-are-its-listeners-also-removed-from-memory
el.removeChild(objEl);
}
}

el.appendChild(objEl)
Expand Down

0 comments on commit da97510

Please sign in to comment.