diff --git a/src/lib/datepicker/datepicker-input.ts b/src/lib/datepicker/datepicker-input.ts index daa6db14f98..57246be64b1 100644 --- a/src/lib/datepicker/datepicker-input.ts +++ b/src/lib/datepicker/datepicker-input.ts @@ -161,6 +161,13 @@ export class MatDatepickerInput implements AfterContentInit, ControlValueAcce this._disabled = newValue; this._disabledChange.emit(newValue); } + + if (newValue) { + // Normally, native input elements automatically blur if they turn disabled. This behavior + // is problematic, because it would mean that it triggers another change detection cycle, + // which then causes a changed after checked error if the input element was focused before. + this._elementRef.nativeElement.blur(); + } } private _disabled: boolean;