Home  >  Q&A  >  body text

Modify matSelect style when displaying options

How to change the properties of mat-select when the option is on?

<mat-select class="selector">
     <mat-option><mat-option>
</mat-select>

.selector:focus {
   color: green;
}

I tried using focus but it didn't work very well and I could click on the pad to select without opening the options.

Solution: Solved the problem using

.mat-select[aria-expanded="true"] { 
    color: green 
}

P粉449281068P粉449281068177 days ago1380

reply all(1)I'll reply

  • P粉729518806

    P粉7295188062024-04-06 00:19:04

    I solved this problem using .mat-select[aria-expanded="true"] { color: green }

    reply
    0
  • Cancelreply