[Bug]: Missing focus-visible indicators on Button and missing focus trap in Modal

Open
#1,450 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@Siddh2024 is already working on this.

Since Nov 22, 2026.

  • #1452 by @Siddh2024 — open

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript, react

Research direction

Start in packages/ui-elements/src/components/Button/Button.styles.js, where outline: none is set without a :focus-visible replacement, then look at packages/ui-elements/src/components/Modal/Modal.js for the missing focus trap. Reproduce with cd packages/react && npx storybook dev -p 6006 and tab through the JOIN button and the Login modal to confirm both behaviours before changing anything. Done means every button shows a visible keyboard focus ring and Tab/Shift+Tab stay inside an open modal. Note that an open pull request (#1452) already targets this, so check it before starting.

Written by the indexing model from the issue text.

Description

bug
Description:

Keyboard navigation across @embeddedchat/ui-elements exhibits two major accessibility compliance issues:

  1. Missing :focus-visible on Button (WCAG 2.4.7 Level AA):
    In packages/ui-elements/src/components/Button/Button.styles.js, outline: none; is set globally without providing an alternate :focus-visible indicator. This causes buttons (such as JOIN, action buttons, modal close, and dialog action buttons) to have invisible focus when navigating via keyboard.

  2. Missing Modal Focus Trap (WCAG 2.1.2 Level A):
    When Modal is opened, keyboard focus escapes the modal container and tabs through background elements behind the modal before cycling back.

Steps to reproduce:
  1. Open Storybook: cd packages/react && npx storybook dev -p 6006
  2. Open http://localhost:6006/iframe.html?id=embeddedchat-simple--simple&viewMode=story
  3. Press Tab — notice no visual focus ring appears on the JOIN button (despite receiving DOM focus).
  4. Press Enter to open the Login modal.
  5. Tab past the form elements — notice focus escapes the modal and navigates through invisible background elements.
Expected behavior:
  • All interactive buttons should have a distinct, visible :focus-visible outline for keyboard users.
  • Modal should trap keyboard focus within the dialog while open.
Proposed Solution:

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

  • Add accessible :focus-visible styles in Button.styles.js.
  • Implement focus trapping in Modal.js so Tab / Shift+Tab cycles only through elements within the open modal dialog.

May I be assigned this issue?

Dominant language
JavaScript
Stars
171
Forks
421
Avg merge
3d 6h
Merged PRs (30d)
4

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RocketChat/EmbeddedChat

All issues in RocketChat/EmbeddedChat

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.