Skip to content

Commit

Permalink
fix(datepicker): add coercion for opened input (#20250)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelss95 committed Aug 19, 2020
1 parent 2c47b06 commit 490a893
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/material/datepicker/datepicker-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,9 @@ export abstract class MatDatepickerBase<C extends MatDatepickerControl<D>, S,
/** Whether the calendar is open. */
@Input()
get opened(): boolean { return this._opened; }
set opened(value: boolean) { value ? this.open() : this.close(); }
set opened(value: boolean) {
coerceBooleanProperty(value) ? this.open() : this.close();
}
private _opened = false;

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

static ngAcceptInputType_disabled: BooleanInput;
static ngAcceptInputType_opened: BooleanInput;
static ngAcceptInputType_touchUi: BooleanInput;
}

0 comments on commit 490a893

Please sign in to comment.