Drop down arrow on mdAutocomplete (like mdSelect h

2019-08-01 09:51发布

问题:

Is there a way to get a drop down arrow on md-autocomplete like md-select has?

It provided a visual clue that the control has a drop down, AND allows the user to open the drop down without typing anything

回答1:

Angular Material does not provide such functionality but you could try to add something like this in your css file:

md-autocomplete-wrap:after {
  display: block;
  content: '\25BC';
  position: relative;
  top: 5px;
  speak: none;
  font-size: 13px;
  left: -10px;
  color: rgba(0,0,0,0.38);
  -webkit-transform: scaleY(.5) scaleX(1);
  transform: scaleY(.5) scaleX(1);
}

Its not perfect solution, but may be enough for you.

And if you want to make dropdown open on click, just add md-min-length="0" attribute to your md-autocomplete.