Only option in mat select

Discussão em 'Angular' iniciado por Venkatesh Prasad, Fevereiro 4, 2025.

  1. I am having a scenario where I need only option in mat multi select. Currently I am adding a button along with the options, and added a functionality to select single item. The issue I am facing is the text Only is getting appended with the option. Here is the code snip: <mat-select [formControl]="selectionControl" (selectionChange)="selectionChange($event.value)" multiple>

    <mat-option class="position-relative options-wrapper"
    *ngFor="let version of [1,2,3,4,5,6,7,8,9,10] [value]="version">
    <span>{{version}}</span>
    <button mat-button class="position-absolute only-btn" style="top:5px; right: 0px;"
    >Only</button>
    </mat-option>
    </mat-select>


    Any help to resolve this is appreciated.

    Continue reading...

Compartilhe esta Página