Skip to content
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
@Narretz

Description

@Narretz

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:

  1. Remember the $pristine state and restore it if was true
  2. Don't use $setViewValue, as it's not really made for that purpose.

Bug was introduced here: 933591d

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions