From 6f87c0442f0df105a7f74b5176a60f14afa3b529 Mon Sep 17 00:00:00 2001 From: melloware Date: Sat, 3 Aug 2024 08:14:48 -0400 Subject: [PATCH] Fix #6978: DT HeaderCheckbox passthrough --- components/lib/datatable/HeaderCheckbox.js | 25 +++++++++++----------- components/lib/datatable/RowCheckbox.js | 5 +++-- components/lib/datatable/RowRadioButton.js | 4 ++-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/components/lib/datatable/HeaderCheckbox.js b/components/lib/datatable/HeaderCheckbox.js index 8793faf2dd..9d8a13f1c7 100644 --- a/components/lib/datatable/HeaderCheckbox.js +++ b/components/lib/datatable/HeaderCheckbox.js @@ -48,19 +48,18 @@ export const HeaderCheckbox = React.memo((props) => { const checkIcon = IconUtils.getJSXIcon(icon, { ...headerCheckboxIconProps }, { props }); const tabIndex = props.disabled ? null : 0; - const headerCheckboxProps = mergeProps( - { - role: 'checkbox', - 'aria-checked': props.checked, - 'aria-label': props.checked ? ariaLabel('selectAll') : ariaLabel('unselectAll'), - tabIndex: tabIndex, - onChange: onChange, - icon: checkIcon, - checked: props.checked, - disabled: props.disabled - }, - getColumnPTOptions('headerCheckbox') - ); + const headerCheckboxProps = { + role: 'checkbox', + 'aria-checked': props.checked, + 'aria-label': props.checked ? ariaLabel('selectAll') : ariaLabel('unselectAll'), + tabIndex: tabIndex, + onChange: onChange, + icon: checkIcon, + checked: props.checked, + disabled: props.disabled, + unstyled: props.unstyled, + pt: getColumnPTOptions('headerCheckbox') + }; return ; }); diff --git a/components/lib/datatable/RowCheckbox.js b/components/lib/datatable/RowCheckbox.js index 3864be4c4a..ec5cd35168 100644 --- a/components/lib/datatable/RowCheckbox.js +++ b/components/lib/datatable/RowCheckbox.js @@ -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, @@ -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 ; }); diff --git a/components/lib/datatable/RowRadioButton.js b/components/lib/datatable/RowRadioButton.js index c82f3fa411..fb7c985be7 100644 --- a/components/lib/datatable/RowRadioButton.js +++ b/components/lib/datatable/RowRadioButton.js @@ -30,7 +30,7 @@ export const RowRadioButton = React.memo((props) => { } }; - const radioButtonProps = mergeProps({ + const radioButtonProps = { role: 'radio', 'aria-checked': props.checked, checked: props.checked, @@ -39,7 +39,7 @@ export const RowRadioButton = React.memo((props) => { onChange: onChange, unstyled: props.unstyled, pt: getColumnPTOptions('rowRadioButton') - }); + }; return ; });