In angular matérial, the mat-select has element mat-pseudo-checkbox who display an check icon in mat-option. I have multiple mat-select and I want to delete or hide this element.
With
::ng-deep .mat-pseudo-checkbox{
display: none!important;
}
I can hide this. But I want hide this for just one mat-select like this
<mat-form-field class="user-list">
<mat-select class="selectAll">
@for (user of userLists; track user) {
<mat-option [value]="user.id">{{user.name}}</mat-option>
}
</mat-select>
</mat-form-field>
2
Answers
Thanks @Naren Murali I found something like this to resolve the issues. Just add [class]="'class-name'" to the mat-option and add css like this :
We could set the
panelClass
which will apply the style only for a particular select, working example below!Mat Select API
HTML
TS
Stackblitz Demo