Skip to content

Commit

Permalink
fix(canary-web-components): update the screen reader text on data tab…
Browse files Browse the repository at this point in the history
…le to use column title

Update the screen reader text on data table to use column title instead of key when sorting columns

. #3015
  • Loading branch information
GCHQ-Developer-530 committed Feb 24, 2025
1 parent 8b010c9 commit e7dfa3b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2310,7 +2310,10 @@ export class DataTable {
{sortable && (
<div class="screen-reader-sort-text" aria-live="polite">
{sortedColumnOrder !== "unsorted" && sortedColumn
? `${sortedColumn} sorted ${sortedColumnOrder}`
? `${
this.columns.find((col) => col.key === sortedColumn)
?.title || sortedColumn
} sorted ${sortedColumnOrder}`
: "table unsorted"}
</div>
)}
Expand Down

0 comments on commit e7dfa3b

Please sign in to comment.