diff --git a/ignite-template.js b/ignite-template.js index 5eb2594..565a7e3 100644 --- a/ignite-template.js +++ b/ignite-template.js @@ -1511,10 +1511,15 @@ class IgniteTemplate { //Setup a intersect observer if needed if (this._intersectObserverCallback && this._intersectObserverCallback.length > 0) { this._intersectObserver = new IntersectionObserver(results => { - if (results[0].isIntersecting) { - for (var i = 0; i < this._intersectObserverCallback.length; i++) { - if (this._intersectObserverCallback[i]) { - this._intersectObserverCallback[i](results[0]); + if (results) { + for (var i = 0; i < results.length; i++) { + if (results[i].isIntersecting && results[i].target == this.element) { + for (var i2 = 0; i2 < this._intersectObserverCallback.length; i2++) { + if (this._intersectObserverCallback[i2]) { + this._intersectObserverCallback[i2](results[i]); + } + } + break; } } }