I have a Blazor form with some radio buttons (inside an InputRadioGroup) and some checkboxes. I'm having two problems with it:
- I have to click the radio buttons twice in order for it to be selected.
- Once selected, if I click a checkbox, the radio gets unselected.
I have reproduced the issue in a new project using the Blazer Server .net 6.0 template by adding this razor component:
<EditForm Model="FormModel">
<InputRadioGroup @bind-Value="FormModel.SelectedRadio">
<InputRadio Value="1" /> 1
<InputRadio Value="2" /> 2
</InputRadioGroup>
<InputCheckbox @bind-Value="FormModel.Checkbox"/>
</EditForm>
@code {
private FormData FormModel { get; set; } = new FormData();
public class FormData
{
public string SelectedRadio { get; set; }
public bool Checkbox { get; set; }
}
}