Skip to content

Commit 6859e49

Browse files
committed
fix(material/timepicker): use Promise.resolve().then() for consistent event timing
1 parent e52eb97 commit 6859e49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/material/timepicker/timepicker.ts

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

0 commit comments

Comments
 (0)