angular-ui / ui-select

AngularJS-native version of Select2 and Selectize
MIT License
3.26k stars 1.81k forks source link

Items disabled through ui-disable-choice are not automatically styled to appear disabled #966

Open henhal opened 9 years ago

henhal commented 9 years ago

When using ui-disable-choice, items are disabled fine in the sense that they cannot be selected, but they are visually not distinguishable from normal enabled items.

I have solved this by applying a ng-class or ng-style to my items using the same condition as ui-disable-choice, e.g.:

            <ui-select-choices repeat="item in items | filter: $select.search" ui-disable-choice="item.disabled">
                <span ng-style="{color: (item.disabled ? '#dddddd' : '#2e2e2e') }" ng-bind-html="item.name | highlight: $select.search"></span>
            </ui-select-choices>

This works, but it would be a million times nicer if the CSS provided by ui-select would include a class for disabled items out of the box (typically, making them light-grey or similar).

yogeshgadge commented 8 years ago

It adds select2-disabled when using theme="select2".

What theme are you using ?