Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #6978: DT HeaderCheckbox passthrough #6981

Merged
merged 2 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading