Repository navigation
Description
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?
Activity
Vulpeeharini26 commentedon Nov 23, 2026
Hi! I'd like to work on this. I'll keep the native checkbox in the DOM but
visually hidden so it's reachable by keyboard and screen readers, add a visible
:focus-visible style, and make sure click/Space both toggle it. Could I take this?
siddharth9874 commentedon Nov 24, 2026
Hi maintainers!
I'd like to work on this issue. I understand it involves improving the CheckBox component's keyboard accessibility, focus indicators, controlled/uncontrolled state support, and Storybook interaction.
I'm interested in contributing a fix and would appreciate it if you could assign this issue to me or confirm that I can work on it.
Thank you!
atanunath66-stack commentedon Nov 24, 2026
Hi maintainers! I noticed that a couple of contributors have expressed interest in this issue. I'm also interested in contributing and can work on the accessibility improvements, controlled/uncontrolled state support, and Storybook updates.
Could you please confirm whether the issue is still open for another contributor, or whether someone has already started working on it?
Thank you!