[Bug]: CheckBox is keyboard-inaccessible (display: none), missing focus indicators, and lacks uncontrolled state support
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, react
調査の方向性
Start in packages/ui-elements at CheckBox.js, where the <input> is hidden with style={{ display: 'none' }}, and read CheckBox.styles.js for the outline: none rule; the story to update lives in CheckBox.stories.js. Reproduce first with cd packages/ui-elements && npx storybook dev -p 6006, tabbing through the default story to confirm the checkbox is skipped. Done means the input stays in the tab order and accessibility tree (visually-hidden CSS rather than display: none), a :focus-visible ring using theme.colors.ring appears, Space toggles it, defaultChecked works uncontrolled, and the jsx-a11y suppression is removed.
索引モデルが issue の本文から書いたものです。
説明
Description:
The CheckBox component in @embeddedchat/ui-elements has several accessibility and usability compliance issues:
-
Inaccessible to Keyboard & Assistive Technologies (WCAG 2.1.1, WCAG 4.1.2):
The underlying<input type="checkbox">is hidden usingstyle={{ display: 'none' }}inCheckBox.js. In all modern browsers,display: 'none'completely removes the input from the accessibility tree and eliminates it from the keyboardTaborder. Consequently:- Keyboard users cannot tab to the checkbox or toggle it using
Space. - Screen readers completely skip it.
- The accessibility linter warning was suppressed with
// eslint-disable-next-line jsx-a11y/label-has-associated-control.
- Keyboard users cannot tab to the checkbox or toggle it using
-
Missing
:focus-visibleOutline (WCAG 2.4.7 Level AA):
CheckBox.styles.jssetsoutline: none;without providing an accessible:focus-visiblering when the checkbox receives focus. -
Lacks Uncontrolled Mode & Interactive State Handling:
CheckBox.jsdoes not manage internal state when used as an uncontrolled input (defaultChecked), and strictly binds tochecked={checked}. When rendered in Storybook or when used without external controller state, the checkbox is completely frozen and does not toggle on click or change.
Steps to reproduce:
- Start Storybook:
cd packages/ui-elements && npx storybook dev -p 6006 - Open
http://localhost:6006/iframe.html?id=components-checkbox--default&viewMode=story - Click on the canvas and press
Tab— observe that the checkbox is completely skipped and cannot receive keyboard focus. - Press
Space— observe that it cannot be toggled via keyboard. - Inspect the DOM in browser DevTools: observe
<input type="checkbox" style="display: none;">and that the Accessibility pane lists the input as not exposed to the accessibility API. - Click the checkbox in the story — observe that it does not toggle because state is locked without uncontrolled support.
Expected behavior:
- The native
<input type="checkbox">should use accessible visually-hidden CSS (e.g.position: absolute; opacity: 0; pointer-events: none;) instead ofdisplay: 'none', keeping it in the DOM accessibility tree and tab order. - The checkbox should display a visible
:focus-visibleoutline matchingtheme.colors.ringwhen focused via keyboard. - Pressing
Spaceshould toggle the checkbox. CheckBoxshould support both controlled (checked+onChange) and uncontrolled (defaultChecked) patterns.- The Storybook story should be interactive.
Proposed Solution:
I would like to resolve this in @embeddedchat/ui-elements:
- Replace
display: 'none'with standard visually-hidden CSS. - Add
:focus-visiblefocus ring styles inCheckBox.styles.js. - Add support for both controlled (
checked) and uncontrolled (defaultChecked/ internal state) usage. - Remove the disabled
jsx-a11y/label-has-associated-controllinter suppression. - Update
CheckBox.stories.jsto allow interactive toggling.
May I be assigned this issue?
- 主要言語
- JavaScript
- スター
- 171
- フォーク
- 421
- 平均マージ
- 3日 6時間
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RocketChat/EmbeddedChat のほかの issue
-
Bug: username fallback in updateUserUsername never runs since the ddp-client migration対応中かも @MuhammadFaizan-prog が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
RocketChat/EmbeddedChat#1489 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Low contrast on color swatch borders in Theme Lab (Layout Editor)対応中かも @yashsarvaiya45 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
RocketChat/EmbeddedChat#1486 ·
メンテナーはふだん 1 日以内に返信
-
bug(api): _doConnect swallows connection/auth errors and marks failed sessions as authenticated対応中かも @ashwanisingh011 が 1 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
RocketChat/EmbeddedChat#1484 ·
メンテナーはふだん 1 日以内に返信
-
Bug: White screen crash (`Cannot read properties of undefined (reading 'members')`) when rendering UserMention outside MarkupInteractionContext対応中かも @swarnendusahu10-dotcom が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
RocketChat/EmbeddedChat#1482 ·
メンテナーはふだん 1 日以内に返信
-
Bug: UIKit PreviewBlock cover image tiles repeatedly and stretches across viewport when zoomed out対応中かも @swarnendusahu10-dotcom が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
RocketChat/EmbeddedChat#1480 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
RocketChat/EmbeddedChat の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Life-Framework/Life-Framework#7017 ·
メンテナーはふだん 1 日以内に返信
-
e/DevOps enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
Accenture/sfmc-devtools#2795 ·
メンテナーはふだん 1 日以内に返信
-
agent/guide documentation help wanted stage/010-actionable
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
kubestellar/console-kb#4003 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
FilOzone/synapse-sdk#1201 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信