Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Dynamically Changing Disabled Attribute Fails to Visually Update Toggle Button on First Load #14

Open
andy-bond opened this issue Jul 3, 2018 · 1 comment

Comments

@andy-bond
Copy link

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):
image

@andy-bond andy-bond changed the title Dynamically Changing Disabled Attribute Fails to Visually Update Toggle Button Dynamically Changing Disabled Attribute Fails to Visually Update Toggle Button on First Load Jul 3, 2018
@matheo
Copy link
Contributor

matheo commented Oct 16, 2018

@andybond006 you should try the latest release, I've synced the code with Angular Material and it should work now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants