Questions tagged [mat-autocomplete]

Autocomplete component for Angular Material. Use for this Material for angular 2+ (i.e., `@angular/material/autocomplete`).

https://material.angular.io/components/autocomplete

144 questions
0
votes
0 answers

How to call remote data with mat-autocomplete and angular 5

I have a form with mat-autocomplete and mat-chip-list components. It works fine with static data that i have in an array. But when i try to load data remotly from a service i have an error : this.carCtrl.valueChanges.startWith is not a…
lory
  • 635
  • 2
  • 10
  • 20
0
votes
1 answer

mat-error doesn't show up on error

I created a Custom Validator method that checks if a value typed into a mat-autocomplete exists in an Array. This method returns { isExchange: true }. I use this.tradeForm.get( 'exchange' ).hasError( 'isExchange' ) inside another method that returns…
0
votes
1 answer

Angular autocomplete with Observable

I am facing a problem with the autocomplete of Angular, I don't manage to display the names instead of the id as you can see on the here : I get my datas as Observable as you can see below : autocomplete.component.ts: driverListItem$:…
-1
votes
0 answers

Mat-Autocomplete Scroll to Selected Item and key up down start with selected item

I am using mat-autocomplete. I am trying to achieve, that when mat-autocomplete is open, then it should scroll to view the selected item and also key press up and down should also start with selected item. I tried this, but its not working. focus is…
-1
votes
1 answer

How to get material mat-autocomplete to allow as valid only a value that is in the option collection amd participate in reactive form validation?

I have a disabled button that I want enabled if the user types a valid value so every key stroke I need to see if it matches..
punkouter
  • 5,170
  • 15
  • 71
  • 116
-1
votes
1 answer

Angular mat-autocomplete shows wrong filtered options

When I enter something into input, I have to find all the options that include that substring. The problem is that the filtered values ​​are not displayed correctly. For example, I have several words: n, new, need, snow. When I enter "n",…
TryBetter
  • 43
  • 5
-1
votes
1 answer

Async validator and mat-autocomplete not working together

In the validate function I do a request to the api to check if the data validates and that works fine. But if the value is an object I just return null but that breaks the mat-autocomplete (the panel never closes). import { ChangeDetectionStrategy,…
-1
votes
1 answer

Mat autocomplete - Remove ID from array when user is removed

I am using this autocomplete to be able to select more than one user. When I select a user, I am storing the ids in a variable using the push. This push will help me keep the ids of all selected users. If you select a user and then want to remove…
Paul sk
  • 293
  • 3
  • 13
-2
votes
2 answers

Is there a way to use angular material autocomplete to autocomplete objects with array of objects that has an id of type number?

Assume that the object array, books = [{id:1, name: 'book1'}, {id:2, name: 'book2'}]; Here you can see that the id of each element in the array is a number. Angular autocomplete component does not work when the array of objects is in the given…
1 2 3
9
10