angular / angular/components

bug(MatSelect): When navigating with keyboard, sometimes the first press of the down arrow is "ignored"

Đang mở
#21,677 6 bình luận 1 reaction 0 người được giao Xem trên GitHub
area: material/select needs: discussion P4
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ả

#### Reproduction

The value of the first `MatOption` in a `MatSelect` must be `null`. Example:
```

-- // <------- Here
Dog
Cat

```

- https://stackblitz.com/edit/angular-lyemh3?file=src%2Fapp%2Fselect-hint-error-example.html

Steps to reproduce:
1. Refresh development server
2. Tab to the `MatSelect`
2. Use the down arrow to make a selection
3. Notice that the very first press appears to be ignored

#### Expected Behavior

The first press of the arrow should select `Dog`.

#### Actual Behavior

The first press of the arrow appears to do nothing.

#### Environment

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

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

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

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện hành vi trong StackBlitz được liên kết với một MatSelect mà MatOption đầu tiên có null value, sau đó lần theo luồng điều hướng bằng bàn phím của MatSelect. Được xem là hoàn tất khi lần nhấn Down Arrow đầu tiên chọn Dog thay vì có vẻ bị bỏ qua, với một bài kiểm thử hồi quy bao phủ trường hợp này.

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
frontend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 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
45/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.