8000 fix(select): Select option with ngOptions when label equals $viewValue by felixcoto · Pull Request #11171 · angular/angular.js · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(select): Select option with ngOptions when label equals $viewValue #11171

Closed

Conversation

felixcoto
Copy link

Fix selectController when using ngOptions and the label equals the $viewValue of the ngModel.
Otherwise, when the options are loaded, selectController set the value of the select to a
non existing value

Fixes #11170

Fix selectController when using ngOptions and the label equals the $viewValue of the ngModel.
Otherwise, when the options are loaded, selectController set the value of the select to a
non existing value

Fixes angular#11170
Fix selectController when using ngOptions and the label equals the $viewValue of the ngModel.
Otherwise, when the options are loaded, selectController set the value of the select to a
non existing value

Fixes angular#11170
Fix selectController when using ngOptions and the label equals the $viewValue of the ngModel.
Otherwise, when the options are loaded, selectController set the value of the select to a
non existing value

Fixes angular#11170
Fix selectController when using ngOptions and the label equals the $viewValue of the ngModel.
Otherwise, when the options are loaded, selectController set the value of the select to a
non existing value

Fixes angular#11170
@petebacondarwin
Copy link
Contributor

This is not really fixing the problem, which is that the optionsMap is storing the label rather than the value of the option and we are trying to compare the $viewValue with the label rather than the "value" of the option, which is sometimes also different to the value of the <option> element. Trouble is that the element value (in Angular 1.3.x) is well related to the value of the option (i.e. it is basically the index value of the element).

This is fixed in Angular 1.4, which is about to be released. Is it possible to update to that version? It would probably be quicker than trying to fix this version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0