Skip to content

Add blur event on mat-row in mat-table #17154

@JeanBaptisteINITIATIVES

Description

Bug, feature request, or proposal:

In Material table, we con only set click event on mat-row. When working with inputs and dynamicals rows with formarray, It should be great to have possibility to add a blur event on the row.

What is the expected behavior?

Add a blur event on mat-row in Material table.

What is the current behavior?

Only click event is possible.

What are the steps to reproduce?

`<table mat-table #orderItemsTable formArrayName="items" [dataSource]="dataSource">

                <ng-container matColumnDef="select" sticky>
                    <th mat-header-cell *matHeaderCellDef>
                        <div class="w-30">
                            <mat-checkbox (change)="$event ? masterToggle() : null" [checked]="selection.hasValue() && isAllSelected()"
                                [indeterminate]="selection.hasValue() && !isAllSelected()">
                            </mat-checkbox>
                        </div>
                    </th>
                    <td mat-cell *matCellDef="let row; let i = index">
                        <div class="w-30">
                            <mat-checkbox (click)="$event.stopPropagation()" (change)="$event ? toggleRow(row) : null"
                                [checked]="selection.isSelected(row)">
                            </mat-checkbox>
                        </div>
                    </td>
                </ng-container>

                <ng-container matColumnDef="product">
                    <th mat-header-cell *matHeaderCellDef class="bl-1"> P.U. HT </th>
                    <td mat-cell *matCellDef="let row; let i = index" tabindex="-1 [formGroupName]="i">
                        {{ row.value }}
                    </td>
                </ng-container>

                <tr mat-header-row *matHeaderRowDef="getDisplayedColumns(); sticky: true"></tr>
                <tr mat-row (blur)="doSomethingOnBlur($event)" *matRowDef="let row; columns: getDisplayedColumns();"></tr>
            </table>`

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

For next release of Angular Material.

Thanks ! Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureThis issue represents a new feature or feature request rather than a bug or bug fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions