Ngx-infinite-scroll: IE11 + infiniteScrollContainer not working

Created on 4 May 2017  路  5Comments  路  Source: orizens/ngx-infinite-scroll

IE11 + [infiniteScrollContainer]

ERROR: Uncaught (in promise): TypeError: Invalid event target at ScrollRegister.prototype.attachEvent

In function ScrollRegister.prototype.attachEvent

investigating

Most helpful comment

The problem comes using a class selector and IE11

[infiniteScrollContainer]="'.myClass'"

I have retrieved the dom element using ViewChild and passed it as an object and it worked

TS:
@ViewChild('scrollZone') el:any;
myDomElement = this.el._element.nativeElement;

HTML:
[infiniteScrollContainer]="myDomElement"

All 5 comments

The problem comes using a class selector and IE11

[infiniteScrollContainer]="'.myClass'"

I have retrieved the dom element using ViewChild and passed it as an object and it worked

TS:
@ViewChild('scrollZone') el:any;
myDomElement = this.el._element.nativeElement;

HTML:
[infiniteScrollContainer]="myDomElement"

I had a similar issue which was related to the window.hasOwnProperty('document') check in resolveContainerElement method which was always "false" for me in IE11.
Because of that the (string) selector itself was used as element when trying to attach the event - which obviously is not possible. Maybe this is the same here?

I exchanged
const hasWindow = window && window.hasOwnProperty('document');
with
const hasWindow = window && window.document && window.document.documentElement;

and it works fine for me now. (IE11, FF latest, Chrome latest, Edge)

This code from @mrucelum is what is working in IE11. #203 doesn't seem to handle the scrolling correctly.

just published 0.7.2 - please confirm

fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

totheskyer picture totheskyer  路  4Comments

trungk18 picture trungk18  路  4Comments

live9080 picture live9080  路  5Comments

sinsunsan picture sinsunsan  路  3Comments

logicalsisufaj picture logicalsisufaj  路  7Comments