Created
April 8, 2021 10:25
-
-
Save Sebazzz/dc33bb9e984774407aa9b9644f356cca to your computer and use it in GitHub Desktop.
RadioOptionGroup is always re-rendering children
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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;} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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