Skip to content

Commit

Permalink
fix on click row
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawan Kumar authored and Pawan Kumar committed Jul 5, 2024
1 parent 3771508 commit 0886840
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ export function Row(props: RowType) {
(primaryColumnId && (props.row.original[primaryColumnId] as Key)) ||
props.index;

const onClickRow = () => {
const onClickRow = (e: React.MouseEvent) => {
props.row.toggleRowSelected();
selectTableRow?.(props.row);
e.stopPropagation();
};

return (
Expand All @@ -59,6 +60,7 @@ export function Row(props: RowType) {
data-is-new={isAddRowInProgress && props.index === 0 ? "" : undefined}
data-rowindex={props.index}
key={key}
onClick={onClickRow}
>
{multiRowSelection && (
<CellCheckboxWrapper
Expand All @@ -70,7 +72,10 @@ export function Row(props: RowType) {
<Checkbox
excludeFromTabOrder={props.excludeFromTabOrder}
isSelected={!!isRowSelected}
onChange={onClickRow}
onChange={() => {
props.row.toggleRowSelected();
selectTableRow?.(props.row);
}}
/>
</CellCheckboxWrapper>
)}
Expand Down

0 comments on commit 0886840

Please sign in to comment.