Questions tagged [md-autocomplete]

is a special input component with a drop-down of all possible matches to a custom query. This component allows you to provide real-time suggestions as the user types in the input area.

docs

https://material.angularjs.org/latest/api/directive/mdAutocomplete

demo

https://material.angularjs.org/latest/demo/autocomplete

syntax

<md-autocomplete
    md-selected-item="selectedItem"
    md-search-text="searchText"
    md-items="item in getMatches(searchText)"
    md-item-text="item.display">
   <span md-highlight-text="searchText">{{item.display}}</span>
</md-autocomplete>

screenshot

enter image description here

131 questions
26
votes
4 answers

material 2 Autocomplete: select option

I want to call a function when an option is selected. After some search it seem that i have to use : property optionSelections of MdAutocompleteTrigger In the documentation…
Yoamb
  • 475
  • 1
  • 5
  • 17
12
votes
3 answers

md-autocomplete ng-pattern="..." does not work

I have the issue with component which is shown in this demo: does not work. I would expect that if some text is entered into Tax field (like zzz) the field is be marked as red as only numbers…
dma_k
  • 10,431
  • 16
  • 76
  • 128
10
votes
1 answer

md-autocomplete onSelectionChange fired twice

I use md-autocomplete angular/material: 2.0.0-beta.5 in my Angular application. With the latest release the selected method has been replaced by onSelectionChange. The first time a value from the drop down is selected, the associated method is…
Francesco
  • 9,947
  • 7
  • 67
  • 110
10
votes
2 answers

how set focus in angular md-autocomplete?

I have a dialog with few field to set, the first field is a md-autocomplete, when I click ok all these fields are cleaned, so, I want set focus true in the md-autocomplete, for starting to filling data again.
mos
  • 337
  • 2
  • 4
  • 11
9
votes
1 answer

Choose by name et get the id in md-autocomplete input in angular 4 material application

I have an angular 4 application with material design. In this application I have a form with an autocomplete field. This is my html code :
Adrien
  • 2,866
  • 4
  • 23
  • 46
8
votes
2 answers

angular material md-autocomplete dynamic loading issue

I'm using Angular Material component "md-autocomplete" in my project. We are trying to render dynamic response that we are getting from "md-list" component's item-click's event call. Issue: However, before the event call is invoked, md-autocomplete…
7
votes
1 answer

disable an item in md-autocomplete

We have a situation where we turned a md-input-container with a md-select / md-option to a md-autocomplete. In the md-select/md-option we were able to have a ng-disabled property on both the md-select and md-option. For the md-autocomplete we…
Doreen
  • 89
  • 3
6
votes
1 answer

How to use ng-blur on md-autocomplete?

I want to use blur event on md-autocomplete but both ng-blur and md-blur not working. $scope.unFocus = function () { alert('Hello!'); }
thanhbebi
  • 163
  • 1
  • 12
5
votes
4 answers

How can i open angular md-autocomplete programmatically?

I need to open angular material md-autocomplete dropdown list on a specific event. Is there any way to do this? I've got md-autocomplete with basic setup similar to this http://codepen.io/paucaverba/pen/GpogPv?editors=101
Alex
  • 81
  • 1
  • 5
5
votes
3 answers

Clear/Reset Material AngualrJS

I want to reset control in Material…
4
votes
0 answers

Getting "ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked" Error with Md Autocomplete

I've been wrestling with this for a while. I've seen lots of people getting this error, but am not sure why I'm getting it in my situation. ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value:…
Jus10
  • 14,519
  • 21
  • 52
  • 77
4
votes
1 answer

md-on-demand inside md-autocomplete

As stated Angular-Material md-autocomplete's documentation: The md-autocomplete uses the the md-virtual-repeat directive for displaying the results inside of the dropdown. I've faced with a problem that I can't find any snippet how can I use…
4
votes
2 answers

md-autocomplete number of items displayed

What controls the number of items displayed in a drop down list for md-autocomplete. I have space for more than the 5 that are being displayed.
ed4becky
  • 1,488
  • 1
  • 17
  • 54
4
votes
4 answers

Angular Material - md-autocomplete dropdown's width

I'm using md-autocomplete from Angular Material: here It seems the dropdown's width goes with the input field's width. If an item's text is too long, there is ellipsis. However, I want to show full text of an item, while keeping the input field's…
Shawn
  • 2,675
  • 3
  • 25
  • 48
4
votes
5 answers

How to restrict input field length (max length) using

I would like to achieve the behavior to restrict/limit users entr to only 10 numbers for ex: Anyone know how to do this? I do see that they have an attribute md-input-maxlength, but i am not able to get it work, or find an example. Appreciate your…
user2919905
  • 63
  • 1
  • 7
1
2 3
8 9