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() {