primeng
primeng copied to clipboard
PrimeNG Radio button not working inside reactive form
Describe the bug
The p-radioButton component is not working properly when used inside a reacive form.
Everytime when I use the radio button component inside reactive form i can select every radiobutton like seen in this screenshot
Environment
<form [formGroup]="hereFormGroup">
<div class="flex flex-col">
<p-radioButton name="myradiobtn" label="btn1"></p-radioButton>
<p-radioButton name="myradiobtn" label="btn2"></p-radioButton>
<p-radioButton name="myradiobtn" label="btn3"></p-radioButton>
<p-radioButton name="myradiobtn" label="btn4"></p-radioButton>
</div>
</form>
Reproducer
No response
Angular version
16.2.0
PrimeNG version
16.4.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20
Browser(s)
No response
Steps to reproduce the behavior
- Create a reactive form in typescript
- Implement form in html template
- Use radiobuttons as described in environment above
Expected behavior
You should be able to select only one radio button at a time