When setting the [disabled]="myBoolean" attribute on the <input> item, the input is successfully disabled, but the <mat-datepicker-toggle> appears to still be a clickable item. If I toggle the myBoolean variable from true, to false, and back to true, the toggle will realize it's supposed to be disabled and will render correctly.
Example code below:
<!-- Expire on Change -->
<mat-checkbox [(ngModel)]="expireOnChange">Expire on Status Change</mat-checkbox>
<!-- Date Input -->
<mat-form-field style="margin-top:1em" appearance="outline" color="accent">
<mat-label>Expiration Date & Time</mat-label>
<input [disabled]="expireOnChange" matInput readonly type="datetime" [matDatepicker]="picker" [(ngModel)]="expiration" />
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker type="datetime" clockStep="5" #picker></mat-datepicker>
</mat-form-field>
Image from when Dialog appears (notice the toggle is white instead of gray):
When setting the
[disabled]="myBoolean"
attribute on the<input>
item, the input is successfully disabled, but the<mat-datepicker-toggle>
appears to still be a clickable item. If I toggle themyBoolean
variable fromtrue
, tofalse
, and back totrue
, the toggle will realize it's supposed to be disabled and will render correctly.Example code below:
Image from when Dialog appears (notice the toggle is white instead of gray):