Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7766fbf

Browse files
committed
fix(template): remove scroll listener
1 parent 024f5fa commit 7766fbf

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

libs/template/experimental/virtual-scrolling/src/lib/virtual-scroll-viewport.component.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ declare const ngDevMode: boolean;
2929

3030
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;
3131

32+
/** Options used to bind passive event listeners. */
33+
const passiveEventListenerOptions = { passive: true };
34+
3235
/**
3336
* @Component RxVirtualScrollViewport
3437
*
@@ -184,9 +187,7 @@ export class RxVirtualScrollViewportComponent
184187
this.scrollContainer(),
185188
'scroll',
186189
this.scrollListener,
187-
{
188-
passive: true,
189-
}
190+
passiveEventListenerOptions
190191
);
191192
}
192193

@@ -208,7 +209,8 @@ export class RxVirtualScrollViewportComponent
208209
getZoneUnPatchedApi(this.scrollContainer(), 'removeEventListener').call(
209210
this.scrollContainer(),
210211
'scroll',
211-
this.scrollListener
212+
this.scrollListener,
213+
passiveEventListenerOptions
212214
);
213215
this.destroy$.next();
214216
this.scrollStrategy.detach();

0 commit comments

Comments
 (0)