问题在于,当你在使用ngAnimate的角度项目中进行ui-select并点击它来输入内容时,你无法输入,直到你第二次点击输入元素为止。基本上,它似乎只专注于第二次点击。
这似乎与bootstrap主题有关,而且列表中没有任何项目。
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'}];*/
});
正如您所看到的,如果您将项目添加到列表中,或者将主题更改为选择,则可以按预期工作。
有什么方法可以解决这个问题吗?