[Bug]: Missing keyboard focus highlights and Escape key handling in Menu dropdown

Đang mở
#1,451 0 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

@Siddh2024 đang làm issue này rồi.

Từ ngày 22/11/2026.

  • #1452 của @Siddh2024 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, react
Lĩnh vực
accessibility, frontend

Hướng nghiên cứu

The fix is scoped to @embeddedchat/ui-elements: Menu.styles.js holds the item/itemMobile style objects (hover only today) and Menu.js holds the dropdown open/close logic. Reproduce with cd packages/react && npx storybook dev -p 6006, opening the kebab menu in the chat header, then Tab and Escape. Done means focus-visible background matches hover and Escape closes the menu and returns focus to the trigger. Note an open pull request (#1452) already targets this, so check it before starting.

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

Mô tả

bug
Description:

The Menu dropdown component in @embeddedchat/ui-elements lacks visual keyboard focus indicators and keyboard dismissal:

  1. No :focus / :focus-visible styles on MenuItem:
    MenuItem.styles.js only provides styles for mouse hover (&:hover). When navigating through menu options using Tab, the DOM element receives focus (via tabIndex="0"), but lacks any visual background highlight.
  2. Missing Escape key listener on Desktop:
    Pressing Escape when the desktop menu is open does not dismiss the menu or return focus to the trigger button.
Steps to reproduce:
  1. Start Storybook: cd packages/react && npx storybook dev -p 6006
  2. Click the three-dot kebab menu in the chat header.
  3. Press Tab repeatedly — observe that options do not visibly highlight or indicate focus.
  4. Press Escape — observe the menu remains open.
Expected behavior:
  • Tabbing through menu items should visibly highlight each option identically to the :hover state.
  • Pressing Escape should close the dropdown and return focus to the three-dot button.
Proposed Solution:

I would like to resolve this in @embeddedchat/ui-elements:

  • Add &:focus, &:focus-visible to item and itemMobile in Menu.styles.js.
  • Add an Escape key listener to Menu.js to dismiss the dropdown and restore trigger focus.

May I be assigned this issue?

Ngôn ngữ chính
JavaScript
Star
171
Fork
421
Merge trung bình
3 ngày 6 giờ
Pull request đã merge (30 ngày)
4

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

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

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 RocketChat/EmbeddedChat

Tất cả issue của RocketChat/EmbeddedChat

Issue tương tự

Thêm issue về JavaScript

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.