Skip to content

Commit 50826fa

Browse files
committed
Update useA11y.ts
1 parent 8e4eee1 commit 50826fa

File tree

1 file changed

+3
-4
lines changed
  • packages/main/src/components/AnalyticalTable/hooks

1 file changed

+3
-4
lines changed

packages/main/src/components/AnalyticalTable/hooks/useA11y.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface UpdatedCellProptypes {
88
'aria-expanded'?: string;
99
'aria-label'?: string;
1010
'aria-colindex': number;
11-
'aria-describedby': string;
11+
'aria-describedby'?: string;
1212
'aria-labelledby': string;
1313
role: string;
1414
}
@@ -23,7 +23,6 @@ const setCellProps = (cellProps, { cell, instance }: { cell: TableInstance['cell
2323
'aria-colindex': columnIndex + 1,
2424
role: 'gridcell',
2525
// header label
26-
'aria-describedby': '',
2726
'aria-labelledby': `${uniqueId}${column.id} ${uniqueId}${column.id}${row.id}`,
2827
};
2928

@@ -44,10 +43,10 @@ const setCellProps = (cellProps, { cell, instance }: { cell: TableInstance['cell
4443
updatedCellProps.onKeyDown = row.getToggleRowExpandedProps?.()?.onKeyDown;
4544
if (row.isExpanded) {
4645
updatedCellProps['aria-expanded'] = 'true';
47-
updatedCellProps['aria-describedby'] += ' ' + a11yElementIds.cellCollapseDescId;
46+
updatedCellProps['aria-describedby'] = ' ' + a11yElementIds.cellCollapseDescId;
4847
} else {
4948
updatedCellProps['aria-expanded'] = 'false';
50-
updatedCellProps['aria-describedby'] += ' ' + a11yElementIds.cellExpandDescId;
49+
updatedCellProps['aria-describedby'] = ' ' + a11yElementIds.cellExpandDescId;
5150
}
5251
} else if (
5352
(selectionMode !== AnalyticalTableSelectionMode.None &&

0 commit comments

Comments
 (0)