fix(ui): use aria-label for Table selection checkboxes

Updated Table selection checkboxes to use aria-label instead of
empty fragment children, improving accessibility and removing the
unnecessary label gap in the selection cells.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
This commit is contained in:
Johan Persson
2026-03-17 12:04:51 +01:00
parent a6b84e13ec
commit 545129a9d8
3 changed files with 9 additions and 6 deletions
@@ -0,0 +1,7 @@
---
'@backstage/ui': patch
---
Updated Table selection checkboxes to use `aria-label` instead of empty fragment children, improving accessibility and removing the unnecessary label gap in the selection cells.
**Affected components:** Table
@@ -73,9 +73,7 @@ export function Row<T extends object>(props: RowProps<T>) {
{selectionBehavior === 'toggle' && selectionMode === 'multiple' && (
<ReactAriaCell className={clsx(classes.cell, classes.cellSelection)}>
<Flex justify="center" align="center">
<Checkbox slot="selection">
<></>
</Checkbox>
<Checkbox slot="selection" aria-label="Select row" />
</Flex>
</ReactAriaCell>
)}
@@ -43,9 +43,7 @@ export const TableHeader = <T extends object>(props: TableHeaderProps<T>) => {
className={classes.headSelection}
>
<Flex justify="center" align="center">
<Checkbox slot="selection">
<></>
</Checkbox>
<Checkbox slot="selection" aria-label="Select all" />
</Flex>
</Column>
)}