Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

increase md-autocomplete box width

I want to increase the width of the md-autocomplete box, since some of the items that appear are not fully displayed (they end in "...").

Is there any way to change the width of md-autocomplete's dropdown box?

like image 496
McDonnas Avatar asked Sep 21 '15 21:09

McDonnas


2 Answers

Add md-menu-class="class-name" attribute to your <md-autocomplete> tag and give CSS to class-name

Please check the version of your angular-material and whether that version supports this feature or not. If the above does not work. Try doing something like following. (Not recommended)

CSS:

.md-virtual-repeat-container.md-autocomplete-suggestions-container {
     width:700px !important;
}

This is working in your codepen. Please try this out.

like image 82
Mohit Adwani Avatar answered Oct 26 '22 07:10

Mohit Adwani


It looks like they fixed this issue, so you can just set the width of the md-autocomplete through css and everything else adjusts appropriately.

<md-autocomplete style="width: 22em;" ...
like image 21
Guy Schalnat Avatar answered Oct 26 '22 08:10

Guy Schalnat