角材质表Firefox Mat Row单击事件,在Mat Cell中单击按钮

时间:2019-01-07 20:52:41

标签: firefox angular-material angular-material2 mat-table onrowclick

我想在可单击的行中使用带角材质的材料表,在Firefox浏览器中使用按钮列

当我第一次添加按钮时,未触发事件(只是行中的事件)。

我阅读了有关该问题的一些主题: Angular Material 2 Table Mat Row Click event also called with button click in Mat Cell

Angular Material table row (click) event triggered when clicking an action in a cell within that row

我在Chrome浏览器上使用event.stopPropagation,但在Firefox 63.0.3(64位)上不能使用它。在Firefox中根本没有触发任何事件。

<mat-table [dataSource]="dataSource" matSort>
.
.
.
  <ng-container *ngIf="roles.approver" matColumnDef="approve">
    <mat-header-cell *matHeaderCellDef mat-sort-header>Approve</mat-header-cell>
    <mat-cell *matCellDef="let element" (click)="$event.stopPropagation()">
      <button mat-icon-button type="button">
        <mat-icon color="primary" (click)="approve(element.receipt_id, 2)">check_circle</mat-icon>
      </button>
    </mat-cell>
  </ng-container>

  <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
  <mat-row *matRowDef="let row; columns: displayedColumns;" (click)="onDetail(row.receipt_id)"></mat-row>

</mat-table>

有人知道它可以与Firefox一起使用吗?

0 个答案:

没有答案
相关问题