Skip to content

Commit 490a893

Browse files
authored
fix(datepicker): add coercion for opened input (#20250)
1 parent 2c47b06 commit 490a893

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/material/datepicker/datepicker-base.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,9 @@ export abstract class MatDatepickerBase<C extends MatDatepickerControl<D>, S,
334334
/** Whether the calendar is open. */
335335
@Input()
336336
get opened(): boolean { return this._opened; }
337-
set opened(value: boolean) { value ? this.open() : this.close(); }
337+
set opened(value: boolean) {
338+
coerceBooleanProperty(value) ? this.open() : this.close();
339+
}
338340
private _opened = false;
339341

340342
/** The id for the datepicker calendar. */
@@ -646,5 +648,6 @@ export abstract class MatDatepickerBase<C extends MatDatepickerControl<D>, S,
646648
}
647649

648650
static ngAcceptInputType_disabled: BooleanInput;
651+
static ngAcceptInputType_opened: BooleanInput;
649652
static ngAcceptInputType_touchUi: BooleanInput;
650653
}

0 commit comments

Comments
 (0)