material icon indicating copy to clipboard operation
material copied to clipboard

Can you add the ability to disable an option in the md-autocomplete list

Open apils opened this issue 10 years ago • 8 comments

I have an autocomplete list, and I want to be able to disable some of the results from the search based on the data. I have managed it by using an item-template containing a div with an ng-click event that stops propagation, but that seems a bit rubbish.

apils avatar Jul 13 '16 16:07 apils

@apils I can't see the point of disabling an item in the autocomplete dropdown?

The autocomplete should only show options that are based on that query (and are apparently valid).

Can you give more details about your desired use-case?

devversion avatar Jul 13 '16 17:07 devversion

This is not supported in the Material Design specifications.

devversion avatar Jul 16 '16 22:07 devversion

@DevVersion A use case for this is when you want to group items in the list like this: https://github.com/angular/material/issues/7417 . The items that label the group should not be clickable.

christiaanwesterbeek avatar Mar 16 '17 10:03 christiaanwesterbeek

@DevVersion Another use case is a list of products where some should not be selectable because of business rules, but you don't want to hide it, you just want to show users that the option is there but not selectable.

andrehil avatar Apr 03 '17 19:04 andrehil

@andrehil. true

Scheinin avatar Nov 14 '17 12:11 Scheinin

How is it going?

rosostolato avatar Feb 19 '18 18:02 rosostolato

I would also like this feature.

tinyweasel avatar Jul 26 '18 15:07 tinyweasel

Please use $mdPanel to implement this custom behavior in your app. This isn't part of the Material Design specifications, so we won't be adding this to AngularJS Material core.

Splaktar avatar Jul 31 '18 01:07 Splaktar