try... catch on getBoundingClientRect()
gustavopaes opened this issue · comments
Gustavo Paes commented
When the element is removed from the DOM, in IE 8 and 9, the call getBoundingClientRect()
break the code.
I did this:
var inView = function (element, view) {
// needs `try catch` because in IE < 10, when the element
// was removed from DOM the getBoundingClientRect() call
// break execution
try {
var box = element.getBoundingClientRect();
return (box.right >= view.l && box.bottom >= view.t && box.left <= view.r && box.top <= view.b);
} catch(e) {
return false;
}
};
Gustavo Paes commented
Maybe #73 resolves too!
Jonathan Fielding commented
Merged #73, can you check that the merged fix, fixes your issue, if it does I can close this issue
Thanks in advance
Gustavo Paes commented
Resolved. Thank you.
Jonathan Fielding commented
😄 awesome glad i could help