Skip to content

Commit

Permalink
perf(module:time-picker): do not run change detection when the timer …
Browse files Browse the repository at this point in the history
…fires (#7143)
  • Loading branch information
arturovt committed Feb 22, 2022
1 parent 148f84d commit 72da774
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions components/time-picker/time-picker-panel.component.ts
Expand Up @@ -534,12 +534,13 @@ export class NzTimePickerPanelComponent implements ControlValueAccessor, OnInit,
this.scrollToTime(120);
});
this.buildTimes();
setTimeout(() => {
this.scrollToTime();
this.firstScrolled = true;
});

this.ngZone.runOutsideAngular(() => {
setTimeout(() => {
this.scrollToTime();
this.firstScrolled = true;
});

fromEvent(this.elementRef.nativeElement, 'mousedown')
.pipe(takeUntil(this.unsubscribe$))
.subscribe(event => {
Expand Down

0 comments on commit 72da774

Please sign in to comment.