Components: [Table] Add directive for clickable mat-row

Created on 25 Oct 2017  路  6Comments  路  Source: angular/components

Bug, feature request, or proposal:

It would be great if mat-row (part of mat-table) supported the navigation list feature that can currently be found in lists. I.e., hover on a row highlighted the row, and click on a row added a ripple. The cursor should change to pointer.

This would be great for tables that are intended to have only one main action.

What is the expected behavior?

If mat-row has a special directive applied, say, nav-row, then hover on a row highlights the row, and click on a row adds a ripple. Also, the cursor should change to pointer.

What is the current behavior?

No highlights or ripples. The cursor is default.

What are the steps to reproduce?

http://plnkr.co/edit/A70Yw5fBc7HLrbDIlivl?p=preview

What is the use-case or motivation for changing an existing behavior?

It would be great for use cases when the user needs to select (by clicking) a single row in a mat-table

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

Angular 4.4.4
Material 2.0.0-beta.11

Is there anything else we should know?

P4 materiatable feature needs discussion

Most helpful comment

Angular material table with ripple effect, check here:
https://stackblitz.com/edit/angular-zjjtui?file=app%2Ftable-basic-example.html

All 6 comments

It's not something that would be built into the row, but possibly a separate direction like matActionRow. The a11y story would need some thought first.

any update about this?

No updates on this yet, we haven't prioritized it but it is on our roadmap for the future

+1, because we can't use MatRipple with MatRow,, bad animation, wrong center point
Edit: we MatRipple not work when using HTML \ So I think this is not necessary, we can make mat-row clickable effect with using MatRipple.
Thanks
I use angular 7.0,2, Angular Material 7.0.2

@ndunks any chance You can share a working example with MatRipple for MatRow?

Angular material table with ripple effect, check here:
https://stackblitz.com/edit/angular-zjjtui?file=app%2Ftable-basic-example.html

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kara picture kara  路  3Comments

michaelb-01 picture michaelb-01  路  3Comments

constantinlucian picture constantinlucian  路  3Comments

LoganDupont picture LoganDupont  路  3Comments

dzrust picture dzrust  路  3Comments