Skip to content

fix(ui-elements): add visible focus to Button and Menu, and trap focus in Modal - #1452

Open
Siddh2024 wants to merge 1 commit into
RocketChat:developfrom
Siddh2024:fix/ui-focus-visible
Open

Siddh2024 wants to merge 1 commit into
RocketChat:developfrom
Siddh2024:fix/ui-focus-visible

Conversation

@Siddh2024

@Siddh2024 Siddh2024 commented Nov 22, 2026 •

Copy link
Copy Markdown

fix(ui-elements): add visible focus to Button and Menu, and trap focus in Modal

Acceptance Criteria fulfillment

  • Added WCAG 2.4.7 compliant :focus-visible outline to Button.styles.js using theme.colors.ring with a standard 2px offset.
  • Implemented WAI-ARIA modal focus trapping in Modal.js using Tab and Shift+Tab boundary cycling.
  • Implemented focus restoration in Modal.js to return keyboard focus to the triggering element upon dialog closure.
  • Added visible :focus and :focus-visible highlights to dropdown menu items in Menu.styles.js matching hover state.
  • Added Escape key listener in Menu.js to dismiss the desktop dropdown and restore focus back to the menu trigger button.
  • Added Changeset patch for @embeddedchat/ui-elements.
  • Verified zero lint errors (yarn lint), formatted with Prettier (yarn format:check), and built successfully (yarn build).

Fixes #1450
Fixes #1451

Video/Screenshots

Screen.Recording.2026-11-22.224729.mp4

PR Test Details

Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-1452 after approval. Contributors are requested to replace <pr_number> with the actual PR number.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant