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

IgxRadioGroup ignores initial disabled state in reactive form

Open Timmeeeey opened this issue 2 years ago • 1 comments

Description

IgxRadioGroup ignores initial disabled state in reactive form.

  • igniteui-angular version: 14.0.5
  • browser: Chrome

Steps to reproduce

<form [formGroup]="form">
  <igx-radio-group name="test" formControlName="radio">
    <igx-radio [value]="'value1'">test1</igx-radio>
    <igx-radio [value]="'value2'">test2</igx-radio>
  </igx-radio-group>
</form>
form = new FormGroup({
  radio: new FormControl({ value: null, disabled: true }),
});

Result

Radio Group is not disabled.

Expected result

Radio Group should be disabled.

Attachments

https://stackblitz.com/edit/angular-obbbi4-az7nrl

Timmeeeey avatar Jul 12 '22 06:07 Timmeeeey

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Sep 11 '22 00:09 github-actions[bot]

@Timmeeeey The radio group disabled property has been deprecated since version 12.2.0 and will be removed in version 15. However, you can still disable individual radio buttons following the same approach. Here is an example: https://stackblitz.com/edit/angular-obbbi4-v8tyzx?file=src/app/app.component.ts

SisIvanova avatar Nov 02 '22 09:11 SisIvanova

@SisIvanova Ok, so I just have to move the formControlName from igx-radio-group to all igx-radio?

<form [formGroup]="form">
  <igx-radio-group name="test">
    <igx-radio [value]="'value1'" formControlName="radio">test1</igx-radio>
    <igx-radio [value]="'value2'" formControlName="radio">test2</igx-radio>
  </igx-radio-group>
</form>

Timmeeeey avatar Nov 02 '22 10:11 Timmeeeey

@SisIvanova Ok, so I just have to move the formControlName from igx-radio-group to all igx-radio?

<form [formGroup]="form">
  <igx-radio-group name="test">
    <igx-radio [value]="'value1'" formControlName="radio">test1</igx-radio>
    <igx-radio [value]="'value2'" formControlName="radio">test2</igx-radio>
  </igx-radio-group>
</form>

Yes, that's right.

SisIvanova avatar Nov 02 '22 10:11 SisIvanova