@page "/"
Forced: @Forced <button @onclick=@(_=>{})>refresh</button>
<br/>@Foo<br/>
<select @key="@Forced" value="@Foo" @onchange=@( e => Update(e) )>
<option>(none)</option>
<option>First</option>
<option>Second</option>
</select>
@code {
private string Foo {get;set;} = "First";
private int Forced {get;set;} = 0;
private Task Update(ChangeEventArgs args) {
if (1 == 1){ // placeholder for other logic
Forced++;
Console.WriteLine($"Here {Forced}");
}
else
{
Foo = args.Value.ToString() ?? "(none)";
}
return Task.CompletedTask; // doesn't actually change it
}
}