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
  • Loading branch information
Cowraider authored Feb 23, 2021
1 parent 5b9591d commit c176c7b
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,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 @@ -30,7 +29,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 @@ -46,9 +44,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 c176c7b

Please sign in to comment.