我在我的 mat-select 中使用 mat-expansion-panel。我第一次打开mat-select
,没关系。但是当我点击mat-select
关闭mat-select
并点击mat-select
第二次重新打开它时,我mat-expansion-panel
的已关闭,我必须双击才能打开它,但不能单击重新打开 mat-expansion-panel
。你能帮助我吗?谢谢 !
<mat-select multiple [formControl]="formControl">
<mat-expansion-panel *ngFor="let group of groups" [expanded]="true">
<mat-expansion-panel-header>
<mat-panel-title title="{{group.name}}">
<mat-checkbox (click)="toggleGroupParent($event, group.name, group.selected)" [(ngModel)]="group.selected" >
{{group.name}}
</mat-checkbox>
</mat-panel-title>
</mat-expansion-panel-header>
<ng-container *ngFor="let item of items">
<mat-option *ngIf="item.type == group.name" [value]="item" (click)="togglePerOneInType(group.name)" title="{{item.text}}">
{{item.text}}
</mat-option>
</ng-container>
</mat-expansion-panel>
</mat-select>