From 5abba18ce43f00175bc7491363e7eff6e1b899dd Mon Sep 17 00:00:00 2001 From: Andreas Ratzberger Date: Tue, 23 Feb 2021 14:48:46 +0100 Subject: [PATCH] fix: reverting change to add scroll eventhandler inside ng cd (#852) (#897) (cherry picked from commit c176c7b7235714a3987d4de3d4110e2e34678183) --- .../src/lib/components/tree-viewport.component.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/projects/angular-tree-component/src/lib/components/tree-viewport.component.ts b/projects/angular-tree-component/src/lib/components/tree-viewport.component.ts index add331f1..a5b2b43a 100644 --- a/projects/angular-tree-component/src/lib/components/tree-viewport.component.ts +++ b/projects/angular-tree-component/src/lib/components/tree-viewport.component.ts @@ -5,7 +5,6 @@ import { AfterViewInit, OnInit, OnDestroy, - NgZone } from '@angular/core'; import { TreeVirtualScroll } from '../models/tree-virtual-scroll.model'; import { TREE_EVENTS } from '../constants/events'; @@ -31,7 +30,6 @@ export class TreeViewportComponent implements AfterViewInit, OnInit, OnDestroy { constructor( private elementRef: ElementRef, - private ngZone: NgZone, public virtualScroll: TreeVirtualScroll ) { this.scrollEventHandler = this.setViewport.bind(this); @@ -47,9 +45,7 @@ export class TreeViewportComponent implements AfterViewInit, OnInit, OnDestroy { this.virtualScroll.fireEvent({ eventName: TREE_EVENTS.initialized }); }); let el: HTMLElement = this.elementRef.nativeElement; - this.ngZone.runOutsideAngular(() => { - el.addEventListener('scroll', this.scrollEventHandler); - }); + el.addEventListener('scroll', this.scrollEventHandler); } ngOnDestroy() {