Changing disable flag in ng-options causes select to be unlselected

Viewed 33

Example of the problem:

https://embed.plnkr.co/5MSJB9E7AMNDF5oZQJRR/

When that is loaded, h is selected even though its disabled. This is fine and expected.

Next, if you selected a non-disabled value, let's say d. That works.

But once you click the button to flip the disable boolean, the model gets set to null and the select loses what's selected.

You can even flip the boolean for the initially selected value to not be disabled and the value stays, but then flip it again and it gets lost.

Is this expected? It doesn't seem that this should happen to me since the first use case allows it to be selected.

2 Answers
Related