Can't get Select component to refresh
Inside a Drawer I have several Select components which are bound to a ViewModel object. When the values are changed in the bound ViewModel the Select components are not refreshing to show the current value. If I output the value on the page as text, the values are correct. I have tried calling StateHasChanged but it's not helping. What can I do to force the Select components to refresh?
To be clear, the items in the DataSource for the Select are not being changed in the code, it's just the @bind-Value which is not refreshing.
Thanks for contacting us @michaelcsikos . It's it only have issue in Drawer? How about put the select components on the page?
Hi @ElderJames, if I place a second instance of the same components on the page bound to the same ViewModel it refreshes correctly, so it appears to be only a problem with the drawer.
If I select a different value in the drawer Select, the second instance on the page immediately refreshes to show the correct value. But editing the page's Select does not refresh in the drawer.
@michaelcsikos Hi, could you provide a demo? I haven't reproduced it on my local (may be different from your usage)
https://github.com/ant-design-blazor/ant-design-blazor/assets/24973084/4ca56ffd-4345-4a86-95d1-0f1863d0ee09
@michaelcsikos Is this select that is not working contained in a form with ValidateOnChange = true?
If so the above pull request will fix. Otherwise this is a separate bug but the pull request is still valid.
My first pull request so go easy on me :).