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
3
votes
2 answers

How to make md-search-text-change wait for 1000ms before firing a call?

Presently, the md-search-text-change event fires a call every time I type something in . I want to delay this. I've tried using debounce. But that has not worked.
3
votes
3 answers

Value not displaying for Material2 Autocomplete

I am trying to get the autocomplete to display one parameter of object but save another and so far it doesn't seem to be behaving. Code is as per Material2 Autocomplete site: Autocomplete The difference is that [value] i want to save 'option.Id' and…
Aeseir
  • 7,754
  • 10
  • 58
  • 107
3
votes
0 answers

md-autocomplete not updating original list

Angular material md-autocomplete not updating/refreshing original list while hitting service. Its working by old list but not update fresh list as text changed in md-autocomplete.
RohitKumar
  • 31
  • 2
3
votes
2 answers

md-autocomplete - remove selected items in suggestion

Im trying to remove an md-item in suggestion when the user selected an item and is marked as favorite. To clarify the question here is the structure below. Supposing that we have this structure of states. function loadAll() { var allStates =…
Shift 'n Tab
  • 8,808
  • 12
  • 73
  • 117
3
votes
1 answer

md-autocomplete md-require-match not working when setting the expression dynamically

I'm setting the autocomplete validation md-require-match = true/false based on the radio button selection. Default validation is md-require-match = true so that user should select an item from autocomplete list. Once it load and user enter some…
Rookie
  • 429
  • 5
  • 16
3
votes
2 answers

angular $validators not firing or misbehaving

(function() { 'use strict'; angular.module('peoplePickerCombo', []); angular.module('peoplePickerCombo') .directive('peoplePicker', function() { return { restrict: 'E' ,require: 'ngModel' ,scope : { ngDisabled …
joyBlanks
  • 6,419
  • 1
  • 22
  • 47
3
votes
5 answers

How to show autocomplete drop-down when first clicking in text box?

I am using a Angular md-autocomplete which starts showing users the auto completion options in a drop-down after they first type in the text box. Is there anyway to have this dropdown shown when the user first clicks in the text box as well? Here is…
Nick
  • 1,743
  • 6
  • 23
  • 38
3
votes
1 answer

md-autocomplete not working

I am using this code to search for movies as the user types movie name in autocomplete box . I am getting the results on console but that is not showing item text Html
3
votes
0 answers

material angular chips with autocomplete

I have a md-chips with autocomplete, but the text in the autocomplete excedes the width and is showed like this: md-chips with autocomplete So, the idea is the suggestbox uses a 100% width or adjust to the word size.
Danilo Velasquez
  • 451
  • 2
  • 11
3
votes
2 answers

text input not shown with md-autocomplete

I'm trying to use angular material's autocomplete component in my website. in the html code I have:
ufk
  • 30,912
  • 70
  • 235
  • 386
3
votes
2 answers

AngularMaterial md-chips : Dont show selected item in

I'm trying the example from here md-chips To prevent the selected items from coming inside I've modified the querySearch function like this: function querySearch (query) { var results = query ?…
Saurabh Verma
  • 6,328
  • 12
  • 52
  • 84
2
votes
1 answer

md-autocomplete in md-dialog loses focus onclick

I am working with AngularJS 1.6 and Angular Material I have an md-autocomplete which used to work really fine, but after i put it in an md-dialog box, it's not working so well anymore. Whenever i click on the autocomplete field, the focus disappears…
2
votes
2 answers

Angular4 Material chipset+autocomplete

I was developing functionality like tagging system in stackoverflow using angular 4 's chipset and autocomplete features. Here is the piece of code i wrote. It is not working
2
votes
1 answer

access md-autocomplete input value before model debouce evaluation in AngularJs

I have a scenario where I want to use ng-model-options to debounce an input value but I have a specific use case where I need to gain access to the raw input value before the debounce cycle. Special case, when user hits the enter key, or presses the…
Chris Schaller
  • 13,704
  • 3
  • 43
  • 81
2
votes
1 answer

(onSelectChange) output for mdOption ALWAYS gets passed first item in list

I'm using Angular Material for Angular 4 (4.3.4) and I need to hook into the selection event to clear the input and store the object in a separate list. But there's a problem: the onSelectChange output ALWAYS gets the first item as the parameter!…
1
2
3
8 9