Skip to content

Conversation

@simonguo
Copy link
Member

@simonguo simonguo commented Dec 5, 2025

  • Create useIndeterminateCheckbox hook to manage indeterminate state
  • Set native checkbox indeterminate property via useLayoutEffect
  • Add test to verify indeterminate property is set correctly
  • Add comprehensive CheckTree tests for indeterminate state

Fixes #4345

Screen readers (NVDA, JAWS, VoiceOver) require the native checkbox indeterminate property to be set via JavaScript, not just aria-checked. This ensures proper announcement of 'mixed' or 'partially checked' state.

@codesandbox
Copy link

codesandbox bot commented Dec 5, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 5, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@vercel
Copy link

vercel bot commented Dec 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
rsuite-main Ready Ready Preview Comment Dec 10, 2025 8:59am
rsuite-storybook Ready Ready Preview Comment Dec 10, 2025 8:59am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
rsuite-v5 Ignored Ignored Preview Dec 10, 2025 8:59am

@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.49%. Comparing base (1c39f37) to head (cfe2495).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4448   +/-   ##
=======================================
  Coverage   94.48%   94.49%           
=======================================
  Files         559      560    +1     
  Lines       13797    13803    +6     
  Branches     4106     4107    +1     
=======================================
+ Hits        13036    13043    +7     
+ Misses        689      688    -1     
  Partials       72       72           
Flag Coverage Δ
chromium 94.49% <100.00%> (+<0.01%) ⬆️
firefox 94.48% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a screen reader accessibility issue by ensuring the native checkbox indeterminate property is set via JavaScript. Screen readers like NVDA, JAWS, and VoiceOver require the native DOM property to properly announce the "mixed" or "partially checked" state, not just the ARIA attribute.

  • Creates a reusable useIndeterminateCheckbox hook that manages the indeterminate state via useLayoutEffect
  • Refactors Checkbox component to use the new hook instead of directly managing refs
  • Adds comprehensive test coverage for both Checkbox and CheckTree components

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/Checkbox/hooks/useIndeterminateCheckbox.ts New hook that synchronously sets the native checkbox indeterminate property using useLayoutEffect
src/Checkbox/Checkbox.tsx Replaces direct useRef with the new hook, removes unused import
src/Checkbox/test/Checkbox.spec.tsx Adds test to verify the native indeterminate property is set correctly
src/CheckTree/test/CheckTree.spec.tsx Adds comprehensive test suite for indeterminate state in parent-child checkbox relationships

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vercel
Copy link

vercel bot commented Dec 10, 2025

Deployment failed with the following error:

Resource is limited - try again in 7 minutes (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/rsuite?upgradeToPro=build-rate-limit

@vercel
Copy link

vercel bot commented Dec 10, 2025

Deployment failed with the following error:

Resource is limited - try again in 6 minutes (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/rsuite?upgradeToPro=build-rate-limit

simonguo and others added 3 commits December 10, 2025 16:51
- Create useIndeterminateCheckbox hook to manage indeterminate state
- Set native checkbox indeterminate property via useLayoutEffect
- Add test to verify indeterminate property is set correctly
- Add comprehensive CheckTree tests for indeterminate state

Fixes #4345

Screen readers (NVDA, JAWS, VoiceOver) require the native checkbox
indeterminate property to be set via JavaScript, not just aria-checked.
This ensures proper announcement of 'mixed' or 'partially checked' state.
@simonguo simonguo force-pushed the fix/checkbox-indeterminate-accessibility branch from bf9ff0b to cfe2495 Compare December 10, 2025 08:52
@simonguo simonguo merged commit 0bcdd9e into main Dec 10, 2025
17 checks passed
@simonguo simonguo deleted the fix/checkbox-indeterminate-accessibility branch December 10, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CheckTree] aria-checked is not announced on native checkbox

2 participants