Skip to content

Commit

Permalink
fix: reverting change to add scroll eventhandler inside ng cd (#852) (#…
Browse files Browse the repository at this point in the history
…897)

(cherry picked from commit c176c7b)
  • Loading branch information
Cowraider authored and Tobias Engelhardt committed Feb 23, 2021
1 parent 835b22b commit 5abba18
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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);
Expand All @@ -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() {
Expand Down

0 comments on commit 5abba18

Please sign in to comment.