radio buttons not working

UI Components for Angular
Post Reply
mmikeyy
Posts: 126
Joined: 11 May 2016, 17:39

05 Aug 2016, 19:18

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.

teaspoon000
Posts: 2
Joined: 31 Jul 2020, 05:48

09 Aug 2020, 03:44

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>

mrTeknokol
Posts: 2
Joined: 15 Apr 2020, 16:06

02 Dec 2020, 13:10

Any fix for this please? having same issue..

Caorda
Posts: 1
Joined: 06 Dec 2019, 00:35

03 Dec 2020, 20:33

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.

tr7oy
Posts: 2
Joined: 24 Aug 2018, 18:20

07 Dec 2020, 20:31

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.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests