Skip to content

Commit

Permalink
fix(AnalyticalTable): fix multi-select checkbox (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas742 authored Apr 22, 2020
1 parent 66a8344 commit 2ed6a98
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ const Cell = ({ row, webComponentsReactProperties: { selectionBehavior, selectio
if (selectionMode === TableSelectionMode.SINGLE_SELECT) {
return <div style={divStyle} onClick={handleCellClick} />;
}
return <CheckBox {...row.getToggleRowSelectedProps()} onChange={handleCellClick} style={customCheckBoxStyling} />;
return (
<CheckBox
{...row.getToggleRowSelectedProps()}
onChange={handleCellClick}
style={customCheckBoxStyling}
data-name="internal_selection_column"
/>
);
};

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ const useInstance = (instance) => {
const selectSingleRow = useCallback(
(row, e, selectionCellClick = false) => {
if (
tagNamesWhichShouldNotSelectARow.has(e.target.tagName) &&
!(e.markerAllowTableRowSelection === true || e.nativeEvent?.markerAllowTableRowSelection === true)
e.target?.dataset?.name !== 'internal_selection_column' &&
!(e.markerAllowTableRowSelection === true || e.nativeEvent?.markerAllowTableRowSelection === true) &&
tagNamesWhichShouldNotSelectARow.has(e.target.tagName)
) {
return;
}
Expand Down

0 comments on commit 2ed6a98

Please sign in to comment.