This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
ngOptions is setting select $dirty when options change and selected option is removed #13362
Closed
Description
When the options change, and the currently selected option is removed because of that, we update the model and set it to the unknown / empty option. We do this by calling $setViewValue, which calls $setDirty. That means if the options change before the user has interacted with the form, the select is set to $dirty even though there was no user interaction.
We could do the following things:
- Remember the $pristine state and restore it if was true
- Don't use $setViewValue, as it's not really made for that purpose.
Bug was introduced here: 933591d