-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Select don't show the selected option with ngOptions label equals the $viewValue #11170
Comments
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
The value of two select is not the same.You should write the html like this: |
Interesting. I see the bug in Chrome, but not in Firefox.It also works in 14.0 snapshot |
I think this is one of the reasons that I completely rewrote the ngOptions directive in 1.4. |
This is fixed n 1.4.x - see http://jsfiddle.net/jdt6s5sm/ |
I think I met the same issue . Going to try the 1.4 version. Is there a workaround for a fix in 1.3.X? This is a common scenario when I need to select the string value of a list of options instead of getting the Id. So typically I need to use " item.Name as Item.Name for item in items". |
OK. I found a ugly workaround:). " item.Name as Item.Name+' ' for item in items". In this way the select and label are not identical. God, this took me a few hours to find out it is a bug....hoho |
We've decided not to fix this issue. See #11835 (comment) for more info |
Go to this JSFiddle:
http://jsfiddle.net/felixcoto/v450hf7o/
This issue is tested in Angular 1.3.13
The text was updated successfully, but these errors were encountered: