Skip to content

fix: add indeterminate state to select-all checkbox in data views (SDK-890)#1948

Draft
aaronlee777 wants to merge 2 commits into
mainfrom
al/SDK-890/table-checkbox-intermediate-state
Draft

fix: add indeterminate state to select-all checkbox in data views (SDK-890)#1948
aaronlee777 wants to merge 2 commits into
mainfrom
al/SDK-890/table-checkbox-intermediate-state

Conversation

@aaronlee777
Copy link
Copy Markdown
Contributor

@aaronlee777 aaronlee777 commented May 27, 2026

Summary

  • The select-all checkbox in DataTable and DataCards now shows a dash icon and enters the native indeterminate state when some (but not all) rows are selected
  • Previously it was always either fully checked or unchecked, with no partial-selection indicator

Changes

  • Added isIndeterminate prop to Checkbox — sets input.indeterminate via a ref (required since indeterminate is a DOM property, not an HTML attribute) and renders the dash icon from the existing checkbox_indeterminate.svg asset
  • Updated useSelectionState to compute and return isIndeterminate alongside allSelected
  • DataTable and DataCards both consume the new value and pass it to their select-all checkbox

Related

Testing

  • New tests cover the indeterminate DOM property on Checkbox, and the partial-selection state on the header checkbox in both DataTable and DataCards
  • Run: npm run test -- --run src/components/Common/UI/Checkbox src/components/Common/DataView/DataTable src/components/Common/DataView/DataCards
  • Storybook: DataViewSelectableWithPagination story — select a subset of rows to verify the dash icon appears in the header checkbox

aaronlee777 and others added 2 commits May 27, 2026 11:36
…views

When only some rows are selected, the select-all checkbox in DataTable
and DataCards now renders a dash icon and sets the native indeterminate
property for screen reader support.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
… DataCards

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@aaronlee777 aaronlee777 marked this pull request as ready for review May 27, 2026 15:45
@aaronlee777 aaronlee777 requested a review from a team as a code owner May 27, 2026 15:45
Copy link
Copy Markdown
Member

@serikjensen serikjensen left a comment

Choose a reason for hiding this comment

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

I think we need to have a chat on this one. For accessibility i think we will need to set aria-checked to mixed https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-checked#mixed

but this is also going to have implications for how we navigate the value/onChange ecosystem since we don't want a situation where you can set the checkbox value to true/false and also indeterminate at the same time

Could you find some time to go over this together? would also be good to include @jeffredodd

@aaronlee777 aaronlee777 marked this pull request as draft May 27, 2026 16:20
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.

2 participants