Skip to content

Commit 708e17b

Browse files
Use aria-sort
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
1 parent 00c3f0e commit 708e17b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/views/shared/workflows-list/workflows-list.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,23 @@ export default function WorkflowsList({
3535
if (col.sortable && sortParams) {
3636
const isActive = sortParams.sortColumn === col.id;
3737

38-
let SortIcon = null;
38+
let SortIcon = null,
39+
ariaSortAttribute: 'ascending' | 'descending' | 'none' =
40+
'none';
41+
3942
if (isActive && sortParams.sortOrder === 'ASC') {
4043
SortIcon = ChevronUp;
44+
ariaSortAttribute = 'ascending';
4145
} else if (isActive && sortParams.sortOrder === 'DESC') {
4246
SortIcon = ChevronDown;
47+
ariaSortAttribute = 'descending';
4348
}
4449

4550
return (
4651
<styled.SortableHeaderCell
4752
key={col.id}
4853
onClick={() => sortParams.onSort(col.id)}
49-
aria-label={`${col.name}, ${isActive ? `sorted ${sortParams.sortOrder}` : 'not sorted'}`}
54+
aria-sort={ariaSortAttribute}
5055
>
5156
{col.name}
5257
{SortIcon && (

0 commit comments

Comments
 (0)