wnr / element-resize-detector

Optimized cross-browser resize listener for elements.
MIT License
1.32k stars 118 forks source link

fix bug: removeListener sometimes not working #138

Open novenn opened 5 months ago

novenn commented 5 months ago

removeListener not working in some scenior:

If the element or its parent has already been removed and appended to the DOM again then Object.onload is been called again, and onElementDetectable will be called again

in some scenarios: users want to removeListener before element been removed but when the element been appended to the DOM again, if onElementDetectable is called then addListener function will be called again