Skip to content

Commit

Permalink
Merge pull request #3248 from mi6/3015-improve-screen-reader-function…
Browse files Browse the repository at this point in the history
…ality-for-sorted-columns

3015 improve screen reader functionality for sorted columns
  • Loading branch information
GCHQ-Developer-530 authored Feb 25, 2025
2 parents d401161 + e7dfa3b commit f1ab953
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 f1ab953

Please sign in to comment.