Skip to content

Commit 6b13a73

Browse files
committed
docs(ui-table): add sort by to the table header label for headers that are not being used to sort
INSTUI-4552
1 parent 78e0b96 commit 6b13a73

File tree

1 file changed

+36
-4
lines changed

1 file changed

+36
-4
lines changed

packages/ui-table/src/Table/README.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,14 @@ By default, the options in the `Select` for sorting in stacked layout are genera
486486
sortDirection: id === sortBy ? direction : 'none'
487487
})}
488488
>
489-
{text}
489+
{id === sortBy ? (
490+
text
491+
) : (
492+
<>
493+
<span aria-hidden="true">{text}</span>
494+
<ScreenReaderContent>sort by {text}</ScreenReaderContent>
495+
</>
496+
)}
490497
</Table.ColHeader>
491498
))}
492499
</Table.Row>
@@ -726,7 +733,14 @@ By default, the options in the `Select` for sorting in stacked layout are genera
726733
sortDirection: id === sortBy ? direction : 'none'
727734
})}
728735
>
729-
{text}
736+
{id === sortBy ? (
737+
text
738+
) : (
739+
<>
740+
<span aria-hidden="true">{text}</span>
741+
<ScreenReaderContent>sort by {text}</ScreenReaderContent>
742+
</>
743+
)}
730744
</Table.ColHeader>
731745
))}
732746
</Table.Row>
@@ -980,7 +994,16 @@ that selection does not re-paginate or re-sort the table, and pagination does no
980994
onRequestSort={onSort}
981995
sortDirection={id === sortBy ? direction : 'none'}
982996
>
983-
{text}
997+
{id === sortBy ? (
998+
text
999+
) : (
1000+
<>
1001+
<span aria-hidden="true">{text}</span>
1002+
<ScreenReaderContent>
1003+
sort by {text}
1004+
</ScreenReaderContent>
1005+
</>
1006+
)}
9841007
</Table.ColHeader>
9851008
))}
9861009
</Table.Row>
@@ -1310,7 +1333,16 @@ that selection does not re-paginate or re-sort the table, and pagination does no
13101333
onRequestSort={onSort}
13111334
sortDirection={id === sortBy ? direction : 'none'}
13121335
>
1313-
{text}
1336+
{id === sortBy ? (
1337+
text
1338+
) : (
1339+
<>
1340+
<span aria-hidden="true">{text}</span>
1341+
<ScreenReaderContent>
1342+
sort by {text}
1343+
</ScreenReaderContent>
1344+
</>
1345+
)}
13141346
</Table.ColHeader>
13151347
))}
13161348
</Table.Row>

0 commit comments

Comments
 (0)