@bind-Selected Option:after doesn't work in my component #3127
-
I have a code that works great for selecting the year
Now I decided to create a reusable component and call it like this
The component code is
when I change the value of the combo elementoSelezionato it is always null |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
Hello everyone, with these changes the component seems to work well
instead of this one
and therefore this
replaces
Clearly I didn't understand why |
Beta Was this translation helpful? Give feedback.
-
Indeed, the change events do not seem to be triggered the way they should In this setup, the setter does not get triggered The same is true for The solution above works with |
Beta Was this translation helpful? Give feedback.
-
Your code does not work because it is using manual Replace the code with below, and you will see the @bind-SelectedOption:after gets called with the selected value:
|
Beta Was this translation helpful? Give feedback.
-
Thank you, In my case it works very well like this:
but I have to set the initial value from the Selected parameter passed by the call
thanks again |
Beta Was this translation helpful? Give feedback.
Your code does not work because it is using manual
FluentOptions
(that dont' have a Value set!!). We can only partially create the needed relation between the component and the options if you specify them manually.Replace the code with below, and you will see the @bind-SelectedOption:after gets called with the selected value:
(this is based on the code from https://www.fluentui-blazor.net/Combobox#from-list-of-option%3Cstring%3E-items)