I am trying to cancel the 'onchange' event for a element after capturing the selected value. Basically just to capture the selected value and return the select element selected item to where it was. How can i do this in Blazor?
<select @onchange="onSelectFilter">
<option value="0">Select a filter</option>
<option value="1">Filter 1</option>
<option value="2">Filter 2</option>
</select>
@code
{
private void onSelectFilter(ChangeEventArgs args)
{
var val = int.Parse(args.Value.ToString());
if (val != 0)
{
//do something
//reset the value to 0
args.Value = 0;
}
}
}
