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

Aperta
#1,451 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Siddh2024 ci sta già lavorando.

Dal 22/11/2026.

  • #1452 di @Siddh2024 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, react

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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?

Lingua principale
JavaScript
Stelle
171
Fork
421
Merge medio
3g 6h
PR unite (30g)
4

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RocketChat/EmbeddedChat

Tutte le issue di RocketChat/EmbeddedChat

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.