Questions tagged [mat-option]
33 questions
0
votes
0 answers
Mat-option cannot be converted to number
I want to display a set of numbers in a menu and I use mat-select/mat-option.
I have a validator that checks if the values of the menu are numbers (since the user can either select a number from the menu or insert one from the keyboard).
I try to…

George Perid
- 87
- 6
0
votes
0 answers
Autocomplete options not properly updating on user input - Angular 14
My problem is that I am updating options for a autocomplete input field based off the user's input. If the user has typed at least three characters in the textbox and the user hasn't typed in the last half second, I'll make an API call based off the…

noname
- 95
- 6
0
votes
1 answer
Selected option is undefined - Angular material
I want to know from a list which options the user selected.
In both ways the event/the object is undefined.
What is the best way to do it?
My first way:

Kate
- 37
- 6
0
votes
1 answer
Angular, mat-option, text format with spaces
I need to display text inside with number of spaces between words. E.g. 'word1__word2' must have two spaces in between. I can do this by replacing the space character with . But this doesn't work if I return a string from a…

Sergey Ch.
- 45
- 8
0
votes
0 answers
How to set a default mat-option value on hover when a mat-autocomplete-panel is opened?
In Angular 14, I'm using the mat-autocomplete component from Material.
When an option has been selected, if the user click on the autocomplete input again, the drop-down list of all available options shows up again but the selected option is not on…

Bravo2bad
- 530
- 1
- 7
- 25
0
votes
1 answer
Angular JS: Showing the mat-option values after clicking the mat-select
Good afternoon!
These days i've been working on a pokemon-based project.
My issue to solve right now is to be able to show the mat-options after clicking the its correspondant mat-select.
Functions to get the trainer names array and the pokemons…

Eric Díaz
- 15
- 4
0
votes
1 answer
Changing value of mat-option based off a conditonal in *ngIf
I have two options for values when it comes to my mat-option
tempTime: TempOptions[] = [
{ value: 100, viewValue: '100 points' },
{ value: 200, viewValue: '200 points' }
];
tempTimesHighNumber: TempOptions[] = [
{ value: 1000,…

GustaMan9000
- 25
- 5
0
votes
0 answers
Manage list in mat-select but keep selected in mat-select and mat-option
I have 3 mat-select options,is it necessary to manage each list to keep selected?
I have 2 ways. 1 is to manage the list of each mat-select option so that ngModel keeps selected, will it affect performance or not? 2 is that I update the list every…
0
votes
1 answer
Prevent Mat-Option from closing the dropdown
I want to know if it is possible to prevent the closing of the dropdown if one mat-option is selected? I am using stopPropagation and preventDefault on the click event, but it doesn't work. Please have a look at the following code.
aktual…

Yusuf Ipek
- 166
- 1
- 11
0
votes
1 answer
How do I format multiple lines in one Mat-Select Option?
I have a mat-select where each mat-option has two lines - a title and description. The title and descriptions are different fonts and are displayed that way in the dropdown. I want the options to keep their formatting once selected and shown in the…

BDev14
- 9
- 7
0
votes
1 answer
How to vertically center placeholder in mat-select-field in Angular?
I have placeholder in mat-select and I want to center it vertically. how do i do this?
closer to the bottom
https://i.stack.imgur.com/7DHz3.png
my codes

emrek52
- 1
- 1
0
votes
1 answer
Angular mat-select, Set different template for items list and selected item
I'm using a mat-option in Angular like this:
{{food.viewValue}}
I want the template in the list of the mat-select to be different…

Erez
- 6,405
- 14
- 70
- 124
0
votes
0 answers
Angular mat-autocomplete not showing dropdown options
I am using an autocomplete so that an option can be selected. The dropdownlist previously worked however that is no longer the case. I am no longer seeing the options. I displayed the options in a div and I am seeing where the options are indeed…

A.Mac
- 203
- 3
- 19
0
votes
2 answers
Mat-options are shown after other component in Angular Material (Custom Theme)
Derived from this question:
Change style Select Angular Material
I face this problem with Angular Material, specifically with mat-select and its mat-options: The mat-options are shown after other components.
I need to show the options just after…

joseluisbz
- 1,491
- 1
- 36
- 58
0
votes
1 answer
I can't select options of mat-select and can't make the selected option appear in console
I have the following problem: I have a drop down list with 2 items. I need the first one to appear by default and that when selecting either of the two its value is shown in the console and saved in a variable. I have the following code:
HTML
…

Aragorn8806
- 17
- 10