angular / angular/components

bug(material/table): Row hover effect is not working since v17.2 (maybe earlier)

オープン
#29,183 コメント 0 件 リアクション 2 件 担当者 0 名 GitHub で見る
area: material/table P3 regression
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

### Is this a regression?

- [X] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

Angular 16

### Description

In Angular Material 16, it was possible to have an hover effect on the entire row of tables, as demonstrated in #26203 (as long as we were able to workaround the bug described in #26203).

After a migration to Angular Material 17, the hover effect disappeared. And it is still not back in v18.

The [spec defines row hover](https://m2.material.io/components/data-tables#behavior), and [MDC supports it ](https://github.com/material-components/material-components-web/blob/cfec83c749a1b6b6602c4d2fa474d3e776e7c97b/packages/mdc-data-table/_data-table-theme.scss#L411).

### Reproduction

You might clone the reproduction repository locally via https://github.com/PowerKiKi/mat-table-v17-does-not-highlight-rows-on-mouseover-anymore. It includes branches for v16.1, v17.2, v17.3 and v18.0.

Or else, see the repo directly on StackBlitz:

- [On v16.1](https://stackblitz.com/~/github.com/PowerKiKi/mat-table-v17-does-not-highlight-rows-on-mouseover-anymore/tree/v16.1), mouseover will works.
- [On v17.2](https://stackblitz.com/~/github.com/PowerKiKi/mat-table-v17-does-not-highlight-rows-on-mouseover-anymore/tree/v17.2), mouseover will not work anymore.
- [Even on the latest v18.0](https://stackblitz.com/~/github.com/PowerKiKi/mat-table-v17-does-not-highlight-rows-on-mouseover-anymore/tree/v18.0), mouseover will not work anymore

### Expected Behavior

Row hover effect must be either be enabled by default, like in v16, or if it might break sticky columns as described in #26730, it should be at least enableable via an attribute/config somewhere.

### Actual Behavior

Row hover effect is not happening anymore.

### Environment

- Angular: 16.1 / 17.2
- CDK/Material: 16.1 / 17.2
- Browser(s): Chrome 125
- Operating System (e.g. Windows, macOS, Ubuntu): Ubuntu

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、リンク先の再現リポジトリで v16.1、v17.2、v17.3、v18.0 ブランチを比較し、次に参照されている MDC の data-table テーマルールと、関連する issue #26203 および #26730 を調査してください。#26730 で説明されている sticky-column の動作を維持したまま、影響を受ける Angular Material のテーブルで行のホバーが再び機能すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。