4

Example plunk here: https://plnkr.co/edit/guzu730yVTramDk7l4ue?p=preview

I'm using angular ui-select and the problem is when I select the first element from the list, it disappears.

select in my html:

<ui-select ng-model="person.selected" theme="bootstrap" search-enabled="false">
    <ui-select-match>{{$select.selected.name}}</ui-select-match>
    <ui-select-choices repeat="person in people">
        <span ng-bind-html="person.name"></span>
    </ui-select-choices>
</ui-select>

Controller:

app.controller('ctrl', function ($scope, $http){
   $scope.people=[
      { id: 1, name: "First" }, 
      { id: 1, name: "Second"}, 
      { id: 1, name: "Third"}
   ];
   $scope.person = {};
   $scope.person.selected = $scope.people[0];
});

In this example:

  1. The select element has "First" person selected.

  2. I select "Second" from the dropdown.

  3. I want to choose "First" again but it's not visible anymore.

Community
  • 1
  • 1
user3743266
  • 1,124
  • 4
  • 16
  • 28

0 Answers0