Skip to content

Instantly share code, notes, and snippets.

@Sebazzz
Created April 8, 2021 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sebazzz/dc33bb9e984774407aa9b9644f356cca to your computer and use it in GitHub Desktop.
Save Sebazzz/dc33bb9e984774407aa9b9644f356cca to your computer and use it in GitHub Desktop.
RadioOptionGroup is always re-rendering children
@page "/"
@using Microsoft.AspNetCore.Components.Forms;
<h1>Hello, world!</h1>
<EditForm Model=@Options>
Radio buttons:
<InputRadioGroup @bind-Value="@RadioGroupVal">
@foreach (var opt in Options) {
<RadioOption @key="opt"/>
}
</InputRadioGroup>
Click the checkbox:
<button type="button" @onclick="@StateHasChanged"/>
</EditForm>
@code {
private List<string> Options = new List<string>() { "A", "B", "C" };
private bool DoesNotMatter {get;set;}
private string RadioGroupVal{get;set;}
}
@using Microsoft.AspNetCore.Components.Forms;
<div style="border: 1px solid black">
<InputRadio Value="Does not matter"/>
@InitTime
</div>
@code {
public DateTime InitTime = DateTime.Now;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment