Page 1 of 1

radio buttons not working

Posted: 05 Aug 2016, 19:18
by mmikeyy
Radio buttons just don't work. Their initial state is set properly, however any button that is clicked is checked and remains checked even when clicking it again or clicking any other button in the same group.

Code: Select all

                        <div *ngFor="let item of list">
                            <p-radioButton
                                    name="groupname"
                                    [value]="item.id"
                                    [label]="item.description"
                                    formControlName="ctrl_name"
                            ></p-radioButton>
                        </div>
Staying with standard radio buttons for now.

Re: radio buttons not working

Posted: 09 Aug 2020, 03:44
by teaspoon000
Still an issue with the 10 version.

Expectation: Only one radio from the group name of "featureGroup" must be selected.
Actual: Both are getting selected.

Code: Select all

        <div class="p-field-radiobutton p-col-12">
          <label for="feature">Featured Property:</label>
          <p-radioButton name="featureGroup" value="true"  label="Yes" inputId="feature" styleClass="inline-radio"></p-radioButton>
          <p-radioButton name="featureGroup" value="false" label="No" inputId="feature" styleClass="inline-radio"></p-radioButton>
        </div>

Re: radio buttons not working

Posted: 02 Dec 2020, 13:10
by mrTeknokol
Any fix for this please? having same issue..

Re: radio buttons not working

Posted: 03 Dec 2020, 20:33
by Caorda
I encountered the same issue after updating to PrimeNG 10.0.3, but it looks like it was fixed in the LTS release. If you don't have that, upgrading to PrimeNG 11.0.0-rc.2 (if that's possible in your scenario) will get you the fix.

Re: radio buttons not working

Posted: 07 Dec 2020, 20:31
by tr7oy
I noticed that when this issue occurred, I had to use ngModel and assign a variable to that. Then, the issue went away. Else, can take care of it by assigning which item is selected in the onClick event.