angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.26k stars 6.7k forks source link

[Table] Add directive for clickable mat-row #8027

Open Maximaximum opened 6 years ago

Maximaximum commented 6 years ago

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?

jelbourn commented 6 years ago

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.

damsorian commented 6 years ago

any update about this?

andrewseguin commented 6 years ago

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

ndunks commented 5 years ago

+1, because we can't use MatRipple with MatRow,, bad animation, wrong center point Edit: we MatRipple not work when using HTML \<table>, \<tr>, \<td>. But work when using \<mat-row> 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

Misiu commented 5 years ago

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

ndunks commented 5 years ago

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

angular-robot[bot] commented 2 years ago

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

angular-robot[bot] commented 2 years ago

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.