Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
452 views
in Technique[技术] by (71.8m points)

angular - Mat-selection-list remove highlight

When I click on an option is mat-selction-list then it remains highlighted

enter image description here

However, I want to remove the highlight because clicking on this option opens a dialog, and when closing the dialog I want to have the list back to normal state:

enter image description here

Any idea how to do this?

Code:

      <mat-selection-list #members
                          fxLayout="row"
                          [multiple]="false"
      >
        <mat-list-option *ngFor="let item of links"
                         fxFlex="50%"
                         class="fs-24 mb-10"
        >
          <a class="fs-24 black" (click)="openDialog(item.key)">
            <div fxLayout="column" fxLayoutAlign="center center">
              <div class="fs-24 mb-5">{{registrationsAll | countIfInData: 'status' : item.key}}</div>
              <div>{{ item.name }}</div>
            </div>
          </a>
        </mat-list-option>
      </mat-selection-list>

question from:https://stackoverflow.com/questions/65952177/mat-selection-list-remove-highlight

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Solved thanks to @zainhassan suggestion !

CSS

.mat-list-option {
  background: transparent;
}


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...