Igniteui-angular: igx-radio - does not remove checked style after another igx-radio gets checked when using Reactive Forms

Created on 25 Apr 2018  路  12Comments  路  Source: IgniteUI/igniteui-angular

Steps to reproduce

  1. Go to https://stackblitz.com/edit/igx-editors-issue
    To make it easy to see what happens, I override default style and have native radios shown.

  2. Click an igx-radio.

  3. Click another igx-radio.

Result

Checked style for the first igx-radio does not be removed.

Expected result

Checked style for the first igx-radio should be removed.

radio-button regression high resolved blocking

All 12 comments

Currently we have a limitation regarding this. It is mentioned in the README.md of the radio. You have to bind to ngModel for the radio buttons to update the checked class.

@simeonoff other editor components/directives(igx-datePicker, igx-time-picker, igxInput and so on) also don't support Reactive Forms?

And do you have a plan to support Reactive Forms?

@tkiryu Hm, the igx-radio does support reactive forms, and so do all of the directives/components you mention above. What makes you think they are not supported in reactive forms?

We've started working on a new component (radio group) which will solve this issue - #1610.

@simeonoff I'm so sorry for the late reply. I missed your mention.
That's because there is the Issue #1144.

@bkulov I got it. I'm looking forward to it!

related to #1610

@tkiryu Once the PRs are merged you could use the new directive as in the example bellow:
default

You could also take a look at the demo I made. It demonstrates igx-radiogroup usage without any bindings, with ngModel binding and with formName and formControlName (reactive forms). The demo could be found in src/app/radio/ folder.

We will be updating the official docs and samples next week.

@bkulov , thank you for your information! I'll check your repo.

By the way, let me ask you some questions about consistency.

There is a similar component called IgxInputGroupComponent.

1) IgxInputGroupComponent is implemented as Component.
Could you tell me why IgxRadioGroupDirective is implemented as Directive?

2) IgxInputGroupComponent's selector is igx-input-group.
So, I think igx-radio-group is better. Could you tell me your thoughts on this?

@tkiryu,
1) IgxInputGroupComponent has an html template. IgxRadioGroupDirective is a directive because we don't need all the functionality a Component provides. Radio group doesn't have a template and only synchronizes the radio buttons selection. Angular Material also have a directive for radio groups.
2) I'll rename the selector to igx-radio-group for consistency.

@bkulov , thank you so much. I got it!

Was this page helpful?
0 / 5 - 0 ratings