Skip to content

fix: update DataTable for xs sizing and header association (#707) - #741

Merged
patricklx merged 1 commit into
mainfrom
fix-issue-707
Aug 8, 2026
Merged

fix: update DataTable for xs sizing and header association (#707)#741
patricklx merged 1 commit into
mainfrom
fix-issue-707

Conversation

@patricklx

Copy link
Copy Markdown
Collaborator

Closes #707

Summary

Parity-check update for DataTable against Carbon React (7 upstream commits, incl. #22509, #22322, #22347, #22268, #22169).

Investigated each recent React change:

  • overflow-menu contextual layout tokens (#22509) — CSS-only via @carbon/styles, already at 1.112.0. No component code change needed.
  • aria-labelledby search landmark labeling (#22347) — already implemented in Ember's search.gts, matches React exactly. No change needed.
  • DataTable pagination story with xs support (#22322) — Ember's Pagination had no @size argument at all. Added @size?: 'xs' | 'sm' | 'md' | 'lg' (defaults to md, matching prior behavior).
  • TableToolbar xs size (#22268) — Ember's Toolbar/SearchInput (within DataTable) had no @size support. Added @size to the toolbar section (cds--table-toolbar--{size}, plus role="group" and a default aria-label="data table toolbar"), and forwarded @size through the DataTable search wrapper to the already-size-capable Search primitive.
  • Associate TableCells with column headers (#22169) — a11y fix so screen readers can map a <td> back to its <th>. Ember's table had no id/headers wiring at all. Added automatic id generation on each <th> and a matching headers attribute on each <td> rendered via table.Column, using row-scoped positional tracking (mirrors the existing pattern already used to share headers/isExpandable/isCheckable onto the table instance). An explicit @header override is also available for consumers who need to opt out of the automatic association.

Since Ember's DataTable doesn't have React's context mechanism, @size is set independently on Toolbar, SearchInput, Table and Pagination rather than propagating automatically — consistent with how this component already handles other per-subcomponent args (e.g. @expandable).

Changes

  • pagination.gts: add @size arg + class
  • data-table/-toolbar.gts: add @size, role="group", default aria-label
  • data-table/-search-input.gts: forward @size to the underlying Search
  • data-table/-header.gts + data-table/-column.gts + data-table/-row.gts: automatic id/headers association between <th> and <td>
  • Docs: new live-preview examples for xs toolbar/pagination sizing in data-table.md, and a sizes example in pagination.md
  • Tests: new data-table-test.gts covering rendering, header/column association, toolbar sizing, and checkable rows; plus Pagination size coverage

Test plan

  • pnpm build succeeds
  • Full test-app suite passes (448/448), including 6 new tests

@patricklx patricklx added parity-check bug Something isn't working preview labels Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📖 Docs Preview

Preview has been removed (PR closed or preview label removed).

github-actions Bot pushed a commit that referenced this pull request Aug 5, 2026
…ociation

- add @SiZe support to Pagination (previously hardcoded to md)
- add @SiZe + role="group"/aria-label to DataTable's TableToolbar and
  forward @SiZe through the toolbar SearchInput to the underlying Search
- automatically associate each data-table <td> with its column <th> via
  the headers attribute, matching upstream React's a11y fix

Signed-off-by: Patrick Pircher <patrick.pircher@ibm.com>
github-actions Bot pushed a commit that referenced this pull request Aug 7, 2026
@patricklx
patricklx merged commit 006132c into main Aug 8, 2026
8 checks passed
@patricklx
patricklx deleted the fix-issue-707 branch August 8, 2026 21:54
github-actions Bot pushed a commit that referenced this pull request Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working parity-check preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Parity Check] Update DataTable component

1 participant