Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor FluentUI: SelectedOptionChanged with enum

$
0
0

I am using FluentUI for Blazor WASM in version 4.10.3 and I have a FluentSelect component that I want to call a function when changed. The default is empty (null), which is fine, but when I call the function OnEnumOptionChanged the new value is also null and not the selected item (which I would expect).

My FluentSelect component

<FluentSelect TOption="EnumOption?" SelectedOptionChanged="OnEnumOptionChanged"><FluentOption Value="@EnumOption.Blue.ToString()">Blue</FluentOption><FluentOption Value="@EnumOption.Red.ToString()">Red</FluentOption><FluentOption Value="@EnumOption.Green.ToString()">Green</FluentOption></FluentSelect>

My callback function

private void OnRedactOptionChanged(EnumOption? enumOption){    // enumOption is null not the selected value    Logger.LogInformation("Selected option {EnumOption}", enumOption);}

How can I fix this to show the selected EnumOption in the callback function? I do not want to use bind.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>