I'm creating multiple radio buttons dynamically using *ngFor, the problem is that it lets me select multiple items from the UI, my code is the following:
<div class="p-col-12">
<p>Tipo de pregunta</p>
<div *ngFor="let tipo_pregunta of tipos_pregunta">
<p-radioButton formControlName="tipo_de_pregunta" inputIt="tipo_pregunta.value" name="tipo_pregunta" [value]="tipo_pregunta" [label]="tipo_pregunta.label" class="p-mb-3"></p-radioButton>
</div>
</div>
If I create the buttons statically, such as:
<p-radioButton name="groupname" value="ps3" formControlName="console"></p-radioButton>
<p-radioButton name="groupname" value="ps4" formControlName="console"></p-radioButton>
<p-radioButton name="groupname" value="ps5" formControlName="console"></p-radioButton>
I have the same issue, any solution?
NOTE: When I submit the form, it just shows the last value I have clicked on, which means the bug is just visual, but it's still confusing and I would like to fix it.