angular-ui / ui-select

AngularJS-native version of Select2 and Selectize
MIT License
3.26k stars 1.81k forks source link

Multi select drop down list isn't updated correctly when objects are pushed into selected list. #1031

Open trbarrett opened 9 years ago

trbarrett commented 9 years ago

I discovered this when we update the selected and selectable lists by pushing into it after a web request.

Here's an example of the problem based of the multi-select demo:

http://plnkr.co/edit/Zcx9XjY3GWG7ShQ493EZ?p=preview

Steps To Reproduce:

Note: if you select or remove an item from the list via the UI the issue will resolve itself.

f1ght4fun commented 9 years ago

Known problem, you can find solution here in changed files. For now until it is pushed to new release i've replaced it manually in my file

https://github.com/angular-ui/ui-select/pull/1019

Jacco1979 commented 9 years ago

I'm having a similar problem, but the difference here is that the array of object is loaded async. I've tried using the fix described in this issue, but that doesn't solve my problem.

See http://plnkr.co/edit/YfqwJwMLrsDxBQbe6Vpi?p=preview

Click on the field and you'll see the drop-down containing all three items, but two are already selected and should have been filtered out of the drop-down.

Jacco1979 commented 9 years ago

My current workaround, since I already was using $route, is using $route's resolve. Which makes sure the array of objects is loaded before the component is rendered.

nicklasb commented 9 years ago

Is this a verified bug now?

wesleycho commented 8 years ago

This looks like it is still an issue, as seen here.

There is one PR open, but it is in need of tests - if someone wants to add tests for it, it should be good to get in the library.

ThCC commented 8 years ago

Any fix for this issue?