orizens / ngx-infinite-scroll

Infinite Scroll Directive for Angular
https://www.npmjs.com/package/ngx-infinite-scroll
MIT License
1.25k stars 223 forks source link

not scroll with angular 9 #346

Closed dan085 closed 4 years ago

dan085 commented 4 years ago

Your issue may already be reported!

Please search on the issue track before creating one.

Expected Behavior

when try to scroll down not work the functions and not call console.log('scrolled!!');

Actual Behavior

Possible Solution

Steps To Reproduce / Demo (if applicable)

[ ] Please share a stackblitz or plunkr demo reproducing this issue

Context

Your Environment

hnakao commented 4 years ago

I have the same issue but using Angular 8. I have installed ngx-infinite-scroll@^8.0.0 like documentation says. I tried to reproduce the same demo exposed here without success. Only works if use a container like a div and set [scrollWindow]="false" and overflow: scroll in style but if I try to use with browser scroller onScroll event never fired. Any idea?

hnakao commented 4 years ago

I solve it setting [infiniteScrollContainer]="selector" where selector is the main container that have scroll style. Like documentation says, I was missing that I have implemented infiniteScroll in smaller component which in turn is contained by the principal.

dan085 commented 4 years ago

@hnakao

I use this code that not work

`import { Component } from '@angular/core';

@Component({ selector: 'app', styles: [ .main-panel { height: 100px; overflow-y: scroll; } ], template: `

</div>

` }) export class AppComponent { selector: string = '.main-panel';

onScroll() { console.log('scrolled!!'); } } `

with [infiniteScrollContainer]="'.main-panel'"

Regards!

dan085 commented 4 years ago

I have problem with child controller inside the home view style youtube in the container

hnakao commented 4 years ago

Is "main-panel" the main container? I suggested find the main panel that contain your component and set in you infiniteScrollContainer property. Also, I know that scrollWindow is true by default but set it too just in case [scrollWindow]=''true".

For example, I create my component with infinite scroll but my theme base have a main container with base-container class, you can see that inspecting your html.

b0lle commented 4 years ago

I have the same issue as the author described. Even the example code does not work. So i edited an Stackblitz, which was running on angular 7 and updated it to 9, using ngx-infinite-scroll 8.0.2 (btw: documentation says, that we should use v9, but its not released now).

The error on Stackblitz is: Error in /turbo_modules/@angular/compiler@9.1.1/bundles/compiler.umd.js (28588:43) this.getExtraNgModuleProviders is not a function

orizens commented 4 years ago

hi. version 9 has been released and should address that.