angular / angular/components

bug(Table): Tab navigation on inputs inside table with sticky columns (focus out of sight)

Đang mở
#28,004 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
Accessibility area: cdk/table area: material/table P3
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
91

Mô tả

### Is this a regression?

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

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

_No response_

### Description

When having multiple inputs on one row, one input per cell, inside a table with one or more sticky columns the TAB key navigation is focusing at some point on an input that is hidden under the sticky columns, making the focus out of sight, but still inside the table.

The current behavior it's not compliant with the latest accessibility guidelines (WCAG) that states that an element that is focused needs to be in sight. (ref link: https://www.w3.org/WAI/WCAG22/Understanding/focus-not-obscured-minimum)

### Reproduction

StackBlitz link:
https://stackblitz.com/edit/r22tvc?file=src%2Fexample%2Ftable-sticky-complex-flex-example.html

Table state:
- have horizontal scroll (requires a higher number of columns)
- one or more columns sticky
- on at least one row have an input on each cell

Steps to reproduce:
1. Scroll the table in order to hide some columns under the sticky columns
2. Focus first inside the first cell of the row with the inputs
3. Press TAB key in order to navigate through the inputs
4. The focus at some point is on the input that is hidden under the sticky columns

### Expected Behavior

The focused element should be in sight, visible, not hidden under the sticky columns.

### Actual Behavior

The focus is hidden under the sticky columns, out of sight.

DEMO:
![table_TAB_focus](https://github.com/angular/components/assets/26005241/58a91a07-5b04-41c3-a54c-f1ccda6b9b8c)

### Environment

- Angular: 16.1.1
- CDK/Material: 16.2.9
- Browser(s): Chrome (118.0.5993.89) / Firefix (119.0)
- Operating System (e.g. Windows, macOS, Ubuntu): Windows x64

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với bản tái hiện StackBlitz tại src/example/table-sticky-complex-flex-example.html và tái hiện vấn đề bằng cách sử dụng cuộn ngang, các cột sticky và các input trong cùng một hàng. Xác minh bản sửa bằng cách nhấn Tab qua từng input và xác nhận rằng phần tử đang được focus vẫn hiển thị thay vì bị các cột sticky che khuất.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
accessibility, frontend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.