Skip to content

Commit

Permalink
fix(Table): mark empty header on the table with aria-hidden when us…
Browse files Browse the repository at this point in the history
…ing the `useRowSelection` hook
  • Loading branch information
plagoa authored and MEsteves22 committed Nov 23, 2023
1 parent 8e0eac1 commit 16d03d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/components/Table/hooks/useRowSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ const DEFAULT_LABELS = {
selectRowCheckBoxAriaLabel: "Select this row",
};

const hideHeaderVariants = ["checkbox", "actions"];

export const CellWithCheckBox = ({ row, labels: labelsProp }) => {
const labels = useLabels(DEFAULT_LABELS, labelsProp);

Expand Down Expand Up @@ -157,7 +159,7 @@ const visibleColumnsHook = (columns) => {
const getHeaderPropsHook = (props, { column }) => {
const nextProps: UseHvRowSelectionTableColumnProps = {};

if (column.id === "_hv_selection") {
if (hideHeaderVariants.includes(column.variant)) {
nextProps["aria-hidden"] = true;
}
return [props, nextProps];
Expand Down

0 comments on commit 16d03d9

Please sign in to comment.