Skip to content

fix(ui-table): fix caption for table to be responsive to sorting#2574

Open
HerrTopi wants to merge 1 commit into
masterfrom
table-caption
Open

fix(ui-table): fix caption for table to be responsive to sorting#2574
HerrTopi wants to merge 1 commit into
masterfrom
table-caption

Conversation

@HerrTopi
Copy link
Copy Markdown
Contributor

@HerrTopi HerrTopi commented Jun 2, 2026

changes the Table caption prop from an auto-appended hardcoded English "Sorted by..." string to a consumer-supplied function (sortByHeader, sortDirection) => string, so the caption reflects sort state in a fully localizable way. In v1 this is non-breaking (caption accepts a ReactNode or a function), while v2 now requires caption to be a function (breaking change), with tests, docs, and the regression page updated accordingly.

TESTS_PLAN

  • With a screen reader (NVDA/VoiceOver), sort a column and confirm the caption announcement reflects the new sort state and uses the consumer-provided (localizable) text, not a hardcoded English suffix.
  • v1 only: pass a plain string caption → confirm it renders unchanged and no sort announcement fires (expected behavior); pass a function → confirm announcements fire on sort change.
  • Confirm sort announcement only fires when the sort actually changes (no duplicate/repeat announcements).

INSTUI-5047

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://instructure.design/pr-preview/pr-2574/

Built to branch gh-pages at 2026-06-02 11:30 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

github-actions Bot pushed a commit that referenced this pull request Jun 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Visual regression report

No changes.

Status Count
Unchanged 32
Changed 0
New 0
Removed 0

📊 View full report

Baselines come from the visual-baselines branch. They refresh on every merge to master.

@HerrTopi HerrTopi requested review from ToMESSKa and matyasf and removed request for matyasf June 2, 2026 11:33
Copy link
Copy Markdown
Contributor

@ToMESSKa ToMESSKa left a comment

Choose a reason for hiding this comment

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

  • In v11.6 examples, there is no announcement which column the table is sorted by (see below)
  • also there is no announcement when I change the sorting in the v11.6 examples
image

Can you please take a look at these?

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