Skip to content

Commit 72da774

Browse files
authored
perf(module:time-picker): do not run change detection when the timer fires (#7143)
1 parent 148f84d commit 72da774

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎components/time-picker/time-picker-panel.component.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,12 +534,13 @@ export class NzTimePickerPanelComponent implements ControlValueAccessor, OnInit,
534534
this.scrollToTime(120);
535535
});
536536
this.buildTimes();
537-
setTimeout(() => {
538-
this.scrollToTime();
539-
this.firstScrolled = true;
540-
});
541537

542538
this.ngZone.runOutsideAngular(() => {
539+
setTimeout(() => {
540+
this.scrollToTime();
541+
this.firstScrolled = true;
542+
});
543+
543544
fromEvent(this.elementRef.nativeElement, 'mousedown')
544545
.pipe(takeUntil(this.unsubscribe$))
545546
.subscribe(event => {

0 commit comments

Comments
 (0)