igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

igx-checkbox: checked state not rendered when disabled

Open rmkrmk opened this issue 8 years ago • 1 comments

Description

The igx-checkbox is not rendering its "checked" state correctly when bound to a boolean field in the code using [(ngModel)]

Steps to reproduce

  1. Create an angular project and import the IgxCheckboxModule

  2. Create a component and define these four fields in the typescript code: checkItem1: boolean = false; checkItem2: boolean = true; checkItem3: boolean = false; checkItem4: boolean = true;

  3. Define these igx-checkbox components in the template: <igx-checkbox [disabled]="false" [(ngModel)]="checkItem1"> <igx-checkbox [disabled]="false" [(ngModel)]="checkItem2"> <igx-checkbox [disabled]="true" [(ngModel)]="checkItem3"> <igx-checkbox [disabled]="true" [(ngModel)]="checkItem4">

  4. Save and run the application.

Result

Checkbox 1 and 2 are enabled and they are correctly displaying their checked state. Checkbox 3 and 4 are disabled and they both look unchecked regardless of the value of the boolean fields they are bound to.

Expected result

Both enabled and disabled checkboxes should render correctly their checked state. See attached image.

Attachments

image

rmkrmk avatar Mar 30 '18 07:03 rmkrmk

You can bind the value to the checked input property until this gets fixed.

For instance:

<igx-checkbox [disabled]="true" [(ngModel)]="checkItem4" [checked]="checkItem4"></igx-checkbox>

simeonoff avatar Mar 30 '18 11:03 simeonoff