Skip to content

Commit 8b33356

Browse files
committed
fix(material/timepicker): use setTimeout instead of Promise for event timing
1 parent e34cffd commit 8b33356

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/material/timepicker/timepicker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ export class MatTimepicker<D> implements OnDestroy, MatOptionParentComponent {
296296
current.deselect(false);
297297
}
298298
});
299-
// Emit the selected event after a microtask to ensure the form control is updated first
300-
Promise.resolve().then(() => {
299+
// Emit the selected event after the current execution cycle to ensure the form control is updated first
300+
setTimeout(() => {
301301
this.selected.emit({value: option.value, source: this});
302-
});
302+
}, 0);
303303
this._input()?.focus();
304304
}
305305

0 commit comments

Comments
 (0)