Skip to content

Commit 2ed6a98

Browse files
authored
fix(AnalyticalTable): fix multi-select checkbox (#445)
1 parent 66a8344 commit 2ed6a98

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

packages/main/src/components/AnalyticalTable/hooks/useRowSelectionColumn.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,14 @@ const Cell = ({ row, webComponentsReactProperties: { selectionBehavior, selectio
5656
if (selectionMode === TableSelectionMode.SINGLE_SELECT) {
5757
return <div style={divStyle} onClick={handleCellClick} />;
5858
}
59-
return <CheckBox {...row.getToggleRowSelectedProps()} onChange={handleCellClick} style={customCheckBoxStyling} />;
59+
return (
60+
<CheckBox
61+
{...row.getToggleRowSelectedProps()}
62+
onChange={handleCellClick}
63+
style={customCheckBoxStyling}
64+
data-name="internal_selection_column"
65+
/>
66+
);
6067
};
6168

6269
/*

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ const useInstance = (instance) => {
4040
const selectSingleRow = useCallback(
4141
(row, e, selectionCellClick = false) => {
4242
if (
43-
tagNamesWhichShouldNotSelectARow.has(e.target.tagName) &&
44-
!(e.markerAllowTableRowSelection === true || e.nativeEvent?.markerAllowTableRowSelection === true)
43+
e.target?.dataset?.name !== 'internal_selection_column' &&
44+
!(e.markerAllowTableRowSelection === true || e.nativeEvent?.markerAllowTableRowSelection === true) &&
45+
tagNamesWhichShouldNotSelectARow.has(e.target.tagName)
4546
) {
4647
return;
4748
}

0 commit comments

Comments
 (0)