Skip to content

Commit

Permalink
Fix #6978: DT HeaderCheckbox passthrough (#6981)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Aug 3, 2024
1 parent 283f7a0 commit 32f16c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions components/lib/datatable/HeaderCheckbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const HeaderCheckbox = React.memo((props) => {
const checkIcon = IconUtils.getJSXIcon(icon, { ...headerCheckboxIconProps }, { props });
const tabIndex = props.disabled ? null : 0;

const headerCheckboxProps = mergeProps({
const headerCheckboxProps = {
role: 'checkbox',
'aria-checked': props.checked,
'aria-label': props.checked ? ariaLabel('selectAll') : ariaLabel('unselectAll'),
Expand All @@ -57,8 +57,9 @@ export const HeaderCheckbox = React.memo((props) => {
icon: checkIcon,
checked: props.checked,
disabled: props.disabled,
unstyled: props.unstyled,
pt: getColumnPTOptions('headerCheckbox')
});
};

return <Checkbox {...headerCheckboxProps} />;
});
Expand Down
5 changes: 3 additions & 2 deletions components/lib/datatable/RowCheckbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const RowCheckbox = React.memo((props) => {
const checkIcon = IconUtils.getJSXIcon(icon, { ...checkboxIconProps }, { props });
const tabIndex = props.disabled ? null : '0';

const checkboxProps = mergeProps({
const checkboxProps = {
role: 'checkbox',
'aria-checked': props.checked,
tabIndex: tabIndex,
Expand All @@ -51,8 +51,9 @@ export const RowCheckbox = React.memo((props) => {
checked: props.checked,
icon: checkIcon,
disabled: props.disabled,
unstyled: props.unstyled,
pt: getColumnPTOptions('rowCheckbox')
});
};

return <Checkbox {...checkboxProps} />;
});
Expand Down
4 changes: 2 additions & 2 deletions components/lib/datatable/RowRadioButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const RowRadioButton = React.memo((props) => {
}
};

const radioButtonProps = mergeProps({
const radioButtonProps = {
role: 'radio',
'aria-checked': props.checked,
checked: props.checked,
Expand All @@ -39,7 +39,7 @@ export const RowRadioButton = React.memo((props) => {
onChange: onChange,
unstyled: props.unstyled,
pt: getColumnPTOptions('rowRadioButton')
});
};

return <RadioButton {...radioButtonProps} />;
});
Expand Down

0 comments on commit 32f16c1

Please sign in to comment.