Hide selected mark in mat-select




Asked on May 15, 2024
I am using Angular Material mat-select. In single selection, a checkmark shows the currently selected value. How to disable it?

<mat-select [formControl]="city">
  <mat-option value="Item1">City A</mat-option>
  <mat-option value="Item2">City B</mat-option>
  <mat-option value="Item3">City C</mat-option>
</mat-select>

If I select 'City B', a checkmark is applied on that option. I want to disable it.



Replied on May 15, 2024
Use hideSingleSelectionIndicator attribute of <mat-select>.

<mat-select [formControl]="city" hideSingleSelectionIndicator>
  ------
</mat-select>

hideSingleSelectionIndicator : Boolean property to hide checkmark indicator.

https://material.angular.io/components/select/api




Write Answer












©2024 concretepage.com | Privacy Policy | Contact Us