Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Multiple select dropdown not populating when options are resolved after model. #268

Open
jox opened this issue Oct 7, 2014 · 5 comments

Comments

@jox
Copy link

jox commented Oct 7, 2014

This is the same issue as described in #133, except it's with multiple select dropdowns.

I've forked the plunker from #133 and changed it to a multiple select using ui-select 0.8.0.

It will wait 5 seconds before the choices are resolved. Clicking the "Change Model" button within this time will trigger the bug. What happens is, that the values are changed to 'null' after they are set in the model.

When "Change Model" is clicked after the 5 seconds, it works as expected.

@dimirc
Copy link
Contributor

dimirc commented Oct 8, 2014

One way to avoid the errors will be define an empty array before the async load:

Currently is :

$scope.people = {};

Change to :

$scope.people = {devs: []};

Check updated plunker

@jox
Copy link
Author

jox commented Oct 8, 2014

Thanks, this does indeed fix it in the isolated plunker example. In our more complex application it does not seem to help though. I'll try to set up another plunker to reproduce it.

@ivanblazevic
Copy link

@jox I had similar issue, when data is resolved all selected values becomes rewritten to null, this fix was working for me #349

@Noemi-
Copy link

Noemi- commented Sep 15, 2015

+1
I got the repeat data from server, and when I set the ng-model to an array which contains repeated properties. The dropdown won't updated, and it still contain the selected values

@wesleycho
Copy link
Contributor

This needs an up to date Plunker based on the latest release.

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

No branches or pull requests

5 participants