igniteui-angular
igniteui-angular copied to clipboard
IgxRadioGroup ignores initial disabled state in reactive form
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
There has been no recent activity and this issue has been marked inactive.
@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
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>
@SisIvanova Ok, so I just have to move the
formControlName
fromigx-radio-group
to alligx-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.