stutrek / scrollmonitor

A simple and fast API to monitor elements as you scroll
MIT License
3.3k stars 243 forks source link

IE11 error on removed elements #64

Open niklashultstrom opened 7 years ago

niklashultstrom commented 7 years ago

Watchers with their watchItem removed by eg. $('.watched-element').remove() will run in to an error on IE11, when trying to access the .getBoundingClientRect()

mahboob-awan commented 6 years ago

@stutrek: Can we check at: https://github.com/stutrek/scrollMonitor/blob/46993cd5eb48fc4bafa1d20d77c958dd09d11d35/src/watcher.js#L127 that if watchItem exist in DOM tree, otherwise skip the operations?

stutrek commented 6 years ago

If you send me a PR with a check I will accept it. I am very busy in my work and personal lives right now. Thanks