Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

bug(Listbox): Can not select first option with Enter after calling .goToFirst() (@angular/aria)

Đang mở
#32,762 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

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

Hướng nghiên cứu

Bắt đầu với bản tái hiện StackBlitz được liên kết, đặc biệt là src/App.ts, và tái hiện chuỗi .goToFirst() rồi Enter. Điều tra vấn đề đồng bộ hóa keyboard-manager được nghi ngờ và xác minh rằng việc nhấn Enter sau khi di chuyển đến tùy chọn đầu tiên sẽ kích hoạt một alert chứa "Option 0" mà không cần Arrow Down.

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

Mô tả

area: aria/listbox P3
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 calling .goToFirst() the first option is set active. But it is not possible to select it with Enter. If the user hits arrow down one time you can select the first option. But my whole reason for calling .goToFirst() is so the user do not need arrows when first option is the one they want.

I suspect an underlying keyboard manager is not being synced when calling `.goToFirst()'

Reproduction

StackBlitz link: https://stackblitz.com/edit/go-to-first-issue-angular-aria-wpcbw3sz?file=src%2FApp.ts
Steps to reproduce:

  1. Load stackblitz
  2. Hit enter
    Hitting enter should trigger en alert with the text "Option 0", but it does not happen
Expected Behavior

When calling .goToFirst() the first option is selected and hitting Enter on the keyboard will select it.

Actual Behavior

Nothing happens when hitting Enter

Environment
  • Angular: 21.1.3
  • CDK/Material: 21.1.3
  • Browser(s): Edge, Firefox
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows, Macos
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
67

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của angular/components

Tất cả issue của angular/components

Issue tương tự

Thêm issue về TypeScript

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.