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

Abierto
#1,451 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@Siddh2024 ya está trabajando en esto.

Desde el 22/11/2026.

  • #1452 de @Siddh2024 — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript, react

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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?

Lenguaje dominante
JavaScript
Estrellas
171
Forks
421
Merge medio
3 d 6 h
PR fusionados (30 d)
4

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de RocketChat/EmbeddedChat

Todos los issues de RocketChat/EmbeddedChat

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.