ui-select
ui-select copied to clipboard
Multiselect box does not become enabled when ng-disabled expression changes to true
The following multiselect box should be disabled until the ng-disabled expression evaluates to true, and then should become enabled. The value of ng-disabled changes as expected, but the multiselect box never becomes enabled again if it started out disabled, or disabled if it started out enabled.
<ui-select multiple ng-model="filterCtrl.contractsSelected" theme="bootstrap" ng-disabled="{{!filterCtrl.companiesSelected.length}}" search-disabled="searchDisabled">
<ui-select-match placeholder="Select contracts...">{{$item.title}}</ui-select-match>
<ui-select-choices group-by="filterCtrl.groupByCompany" repeat="contract in filterCtrl.contractList | filterContractsByCompany:filterCtrl.companiesSelected | filter:$select.search | orderBy:'title'">
<div ng-bind-html="contract.title"></div>
</ui-select-choices>
</ui-select>
@chelzwa I had the same issue, but found that there is no need of {{}} in the ng-disabled directive, because it accepts expression. Look here: https://docs.angularjs.org/api/ng/directive/ngDisabled
I think that this issue can be closed as it is not ui-select connected.
Cheers, Marta