Dropdownlist selected value not updating
Didn't take me long to trace this back to the cached list of Select List Item.Clearly the list was getting updated - apparently through the model binding process in the selection postback.To clarify the scenario here's the drop down list definition in the Razor View: This seemed normal enough to me - I've been doing stuff like this forever caching smallish lists in memory to avoid an extra trip to the database.This list is used in various places throughout the application - for the list display and also when adding new items and setting up for notifications etc..
This can be reproduced with the reactive forms dropdownlist example directly on the site, unmodified The form Control's value will not update when: The dropdownlist is expanded with a click , a new value is selected with the down arrow and the control is closed using the tab key Issue can be reproduced on demo site https:// Direct link to the plunkr used on demo site QNi Wmbdpg Zo8J?I updated the provided js Fiddle demo to demonstrate the suggested approach.If you would like to get an additional technical support on the subject, then I would like to point you to the two available options: Generally speaking, the model should be the single source of truth and the UI needs to be synced to it on initial load.Sure enough when stepping through the code I see that when an item is selected the actual model - model. But it's also a problem because the array is getting updated by multiple ASP.NET threads which likely would lead to odd crashes from time to time. In retrospect the modelbinding behavior makes perfect sense.