-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Choices not contain value that same with initial ng-model value #1660
Comments
Hello, I have the same probblem !! Do you already have a solution ??? |
I have solution to use $timeout, but this workaround is bad..
|
Can you please describe the problem in text as well through screen recording? (Reproduction steps, expectations etc.) For those who are not able to view the video. Also, a plunkr is a lot more useful than zip file if possible 😃 |
Here you go: Plunkr Note that this Plunkr uses Angular 1.5.6 and UI-Select 0.18.0 Note that the first item in the itemArray is used as the intial value of the ng-model. When triggering the display of the choices in the select, item 'First' is not displayed as a choice. |
Ok, more info. Explicitly setting the remove-selected attribute to "false" on the element will prevent the initial ng-model value from being removed from the collection of choices, regardless of whether the 'multiple' attribute is set on . Whatever logic is being invoked to remove selected items from the collection of choices should probably check whether the multiple attribute is present as well as the state of the remove-selected attribute. It looks like this remove-selected functionality was added/last modified as part of #1622 |
willisd3, thanks for your info. With remove-selected="false" everything works fine for me.
|
I noticed that in 0.16.0 this was working properly. |
Another issue related to this occurs when you press the 'Enter' key to make your selection. If you use your mouse to make selections after making a selection using the 'Enter' key you will notice that the item selected using the 'Enter' key remains hidden until you make another selection using the 'Enter' key. The remove-selected attribute fixes this as well. |
Closing as duplicate of #1654 |
add remove-selected="false" option to ui-select directive
|
Bug description:
Choices not contain value that same with initial ng-model value
Link to zip-file that contain the issue:
https://drive.google.com/file/d/0Bxtv10NlSOEbR3I5UWZPZDVvSFE/view?usp=sharing
Link to screen record that contain the issue:
https://drive.google.com/file/d/0Bxtv10NlSOEbODhXNkJVZ18wem8/view?usp=sharing
Version of Angular
1.5.0
UI-Select
0.17.1
The text was updated successfully, but these errors were encountered: