Skip to content

Commit c176c7b

Browse files
authored
fix: reverting change to add scroll eventhandler inside ng cd (#852) (#897)
1 parent 5b9591d commit c176c7b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

projects/angular-tree-component/src/lib/components/tree-viewport.component.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
AfterViewInit,
55
OnInit,
66
OnDestroy,
7-
NgZone
87
} from '@angular/core';
98
import { TreeVirtualScroll } from '../models/tree-virtual-scroll.model';
109
import { TREE_EVENTS } from '../constants/events';
@@ -30,7 +29,6 @@ export class TreeViewportComponent implements AfterViewInit, OnInit, OnDestroy {
3029

3130
constructor(
3231
private elementRef: ElementRef,
33-
private ngZone: NgZone,
3432
public virtualScroll: TreeVirtualScroll
3533
) {
3634
this.scrollEventHandler = this.setViewport.bind(this);
@@ -46,9 +44,7 @@ export class TreeViewportComponent implements AfterViewInit, OnInit, OnDestroy {
4644
this.virtualScroll.fireEvent({ eventName: TREE_EVENTS.initialized });
4745
});
4846
let el: HTMLElement = this.elementRef.nativeElement;
49-
this.ngZone.runOutsideAngular(() => {
50-
el.addEventListener('scroll', this.scrollEventHandler);
51-
});
47+
el.addEventListener('scroll', this.scrollEventHandler);
5248
}
5349

5450
ngOnDestroy() {

0 commit comments

Comments
 (0)