-
Hi, I have a problem with Radio component from Release 0.9.2.5. When selecting another Radio and then reselecting this one, nothing happens. <Table>
<TableBody>
<TableRow>
@foreach (var v in Enumerable.Range(0, Choices.Count))
{
<TableRowCell TextAlignment="TextAlignment.Center" Color="(Selection < 0 ? Color.None : (Selection == Expected ? Color.Success : Color.Danger))">
<Radio TValue="int" Value="@v" Group="SELECT" CheckedChanged="@((chk) => OnSimpleChoice(v, chk))">@Choices[v]</Radio >
</TableRowCell>
}
</TableRow>
</TableBody>
</Table>
@code {
[Parameter]
public List<string> Choices { get; set; }
[Parameter]
public int Expected { get; set; }
private int Selection = -1;
async private void OnSimpleChoice(int idx, bool chk)
{
Console.WriteLine("OnSimpleChoice {0}={1}", Choices[idx], chk);
if(chk)
{
Selection = idx;
await InvokeAsync(() => StateHasChanged());
}
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
KroMignon
Feb 10, 2021
Replies: 1 comment
-
I answer myself! <Radio TValue="int" Value="@v" Group="SELECT" CheckedChanged="@((chk) => OnSimpleChoice(v, chk))" Checked="@(v==Selection)">@Choices[v]</Radio > |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
KroMignon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I answer myself!
I found how-to resolve this by changing Radio with: