angular-ui / ui-select2

AngularJS wrapper for select2 (deprecated, use angular-ui/ui-select)
https://github.com/angular-ui/ui-select
MIT License
596 stars 443 forks source link

label for dropdown select not actually changing #226

Closed josephtannenbaum closed 6 years ago

josephtannenbaum commented 10 years ago

Edit: This is essentially a duplicate of #46

The issue in one image: image of issue

In words: when you click on a dropdown option, it doesn't show up in the select (if you click it again, it shows up). I've reproduced the issue in plnkr: http://plnkr.co/edit/Yh0vRU0xVbFbnYpHzKPk?p=preview

The code:

      $scope.stopGroupings = {"ny" : "east", "nj" : "east", "ca": "west"};
      $scope.stopNames = ["ny","nj","ca"];
<div ng-controller="MyCtrl">
    <select ui-select2 ng-model="t.selectedLoc" data-placeholder="Where are you?" style="width:250px" ng-options="stopName as stopName group by stopGroupings[stopName] for stopName in stopNames" >
        <option></option>
    </select>   
<p>Chosen Item: {{t.selectedLoc}}  </p>
</div>

This is with jquery 2.0.0 and angular.js 1.2.16

Note: I understand that using ng-repeat makes the problem go away, but I'd like the "group by" functionality of ng-options.

justinobney commented 10 years ago

I am having the same issue, as seen here: http://plnkr.co/edit/g1G0PEJfNQdmZbiJSLgE?p=info

mrcmorales commented 10 years ago

+1 same problem!

Steenkuyl commented 10 years ago

+1 same problem