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

未关闭
#1,450 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@Siddh2024 已经在做这个了。

开始于 2026年11月22日。

  • #1452 来自 @Siddh2024 —— 未关闭

评估

难度
3/5
预计耗时
半天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
javascript, react

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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?

主要语言
JavaScript
星标
171
派生
421
平均合并
3 天 6 小时
30 天内合并 PR
4

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

RocketChat/EmbeddedChat 的其他 Issue

查看 RocketChat/EmbeddedChat 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。