I have this angular material table with selection stackblitz from angular material website.
This table with selection allows you to select the table row by clicking the checkbox and any other space outside the checkbox but within the row.
What changes should I make to make selection of table row by only the checkbox?
Remove (click)="selection.toggle(row)"
from the last tr
it should be
<tr mat-row *matRowDef="let row; columns: displayedColumns;">
</tr>
instead of
<tr (click)="selection.toggle(row)" mat-row *matRowDef="let row; columns: displayedColumns;">
</tr>
demo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With