Skip to content

[6.x] Name table cells once, after their column and row - #19890

Merged
brandonkelly merged 3 commits into
6.xfrom
brian/table-control-cell-names
Oct 7, 2026
Merged

brandonkelly merged 3 commits into
6.xfrom
brian/table-control-cell-names

Conversation

@brianjhanson

@brianjhanson brianjhanson commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Fixes how table cells are named for screen readers, and adds a browser test that checks it.

  • CheckboxControl: inside a table cell, the checkbox was named by both its own label and the field label ("Homepage, row 1 Homepage, row 1"), and the label showed next to the box. When the field label is screen-reader-only, it now names the checkbox alone.
  • ChoiceControl: the select presentation no longer passes the field label to craft-select as well, which had named it twice.
  • TableControl.a11y.browser.test.ts: checks in Chromium that every editable cell is named "{column}, row {n}", that tables sharing column keys don't label each other's inputs, and that IDs are unique.

This replaces PreviewTargetsTable.test.ts, which was added in fa3848b and lost in #19888 when preview targets were rebuilt on the form builder's TableControl. That test only checked that the Auto-Refresh lightswitch was named after its column header. The new test covers all cell types (text, lightswitch, checkbox and the prefix select), not just lightswitches.

🤖 Generated with Claude Code

Checkbox and select cells were labelled by both their own label and the
field label, so screen readers read the name twice. Adds a browser test
covering every cell type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

📚 Storybook previews

@craftcms/ui — open Storybook

No changed components detected in this Storybook.

resources/js — open Storybook

No changed components detected in this Storybook.

@brianjhanson brianjhanson changed the title Name table cells once, after their column and row [6.x] Name table cells once, after their column and row Oct 7, 2026
brandonkelly and others added 2 commits October 7, 2026 14:21
@brandonkelly
brandonkelly merged commit 8805f74 into 6.x Oct 7, 2026
20 checks passed
@brandonkelly
brandonkelly deleted the brian/table-control-cell-names branch October 7, 2026 21:56
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