Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mat Select appears in the bottom of the page

I have a problem while trying to show the list of values contained in a <mat-select>. I get all the list of options in the bottom of the page instead of showing them next to the arrow of the <mat-select>.

enter image description here

like image 246
Hana_CH Avatar asked Nov 15 '25 07:11

Hana_CH


2 Answers

Include a theme, e.g. by adding this line to your styles.css:

@import "~@angular/material/prebuilt-themes/indigo-pink.css";

like image 177
jsalvata Avatar answered Nov 17 '25 20:11

jsalvata


You don't need to include any pre-built Angular themes and doing so might interfere with custom themes. You only need to include the mat-core() mixin from angular theming.

Add this to your styles.scss

@import "../node_modules/@angular/material/theming";
@include mat-core();
like image 45
Si1975 Avatar answered Nov 17 '25 22:11

Si1975