4

问题是,当您在使用 ngAnimate 的 Angular 项目中有一个 ui-select 并单击它以输入内容时,您无法输入,直到您再次单击输入元素。基本上,它似乎只关注第二次点击。

这似乎是引导主题的问题,并且列表中没有任何项目。

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

  <ui-select ng-model="country.selected" theme="bootstrap" ng-disabled="disabled" style="width: 300px;">
    <ui-select-match placeholder="Select or search a country in the list...">{{$select.selected.name}}</ui-select-match>
    <ui-select-choices repeat="country in countries | filter: $select.search">
      <span ng-bind-html="country.name | highlight: $select.search"></span>
      <small ng-bind-html="country.code | highlight: $select.search"></small>
    </ui-select-choices>
  </ui-select>

var app = angular.module('selectizeDemo', [
  'ngAnimate',
  'ngSanitize', 
  'ui.select'
  ]);

app.controller('MainCtrl', function($scope) {

    $scope.countries = [];

  /*$scope.countries = [ 
    {name: 'Afghanistan', code: 'AF'},
    {name: 'Åland Islands', code: 'AX'},
    {name: 'Albania', code: 'AL'},
    {name: 'Algeria', code: 'DZ'},
    {name: 'American Samoa', code: 'AS'},
    {name: 'Andorra', code: 'AD'},
    {name: 'Angola', code: 'AO'},
    {name: 'Anguilla', code: 'AI'},
    {name: 'Antarctica', code: 'AQ'},
    {name: 'Antigua and Barbuda', code: 'AG'}];*/
});

如您所见,如果您将项目添加到列表中,或者将主题更改为选择,它会按预期工作。

有没有办法解决这个问题?

4

0 回答 0