You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using nbInfiniteList in combination with listenWindowScroll almost always results in the following error, which results in NbInfiniteListDirective not receiving any scroll events.
ERROR TypeError: Cannot read property 'nativeElement' of undefined
at NbLayoutComponent.getDimensions (index.js:10644)
at SafeSubscriber._next (index.js:10539)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:183)
at SafeSubscriber.next (Subscriber.js:122)
at Subscriber._next (Subscriber.js:72)
at Subscriber.next (Subscriber.js:49)
at TakeUntilSubscriber._next (Subscriber.js:72)
at TakeUntilSubscriber.next (Subscriber.js:49)
at Subject.next (Subject.js:39)
at Observable._subscribe (index.js:2134)
It probably is some kind of race condition, but I can't find out where.
Expected behavior:
Infinite scroll with listenWindowScroll should work as advertised.
The text was updated successfully, but these errors were encountered:
dabide
changed the title
Infinite list with listenWindowScroll mostly doesn't work
Infinite list with listenWindowScroll doesn't work most of the time
Oct 7, 2020
scrollableContainerRef is a ViewChild() of LayoutComponenthere
getDimensions() is somehow called before ngAfterViewInit(), meaning that the scrollableContainerRef hasn't been loaded/set yet. This causes the cannot read property 'nativeElement' of undefined error.
I believe this is caused because of this line here.
If the subscription in 3. was setup in ngAfterViewInit() I believe it would fix the issue.
Issue type
I'm submitting a ... (check one with "x")
Issue description
Current behavior:
Using
nbInfiniteList
in combination withlistenWindowScroll
almost always results in the following error, which results inNbInfiniteListDirective
not receiving any scroll events.It probably is some kind of race condition, but I can't find out where.
Expected behavior:
Infinite scroll with
listenWindowScroll
should work as advertised.Steps to reproduce:
Just refresh https://www.akveo.com/ngx-admin/pages/layout/infinite-list a couple of times, and the error message will show in the console.
OS: Windows 10/Chrome and Ubuntu/Firefox
The text was updated successfully, but these errors were encountered: