Skip to content

Commit

Permalink
feat: added onRowExpandToggled prop to expander cell
Browse files Browse the repository at this point in the history
  • Loading branch information
ravgeetdhillon committed Aug 13, 2024
1 parent 50f5f8e commit 4e56129
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/DataTable/TableCellExpander.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type CellExpanderProps<T> = {
expandableRowsSingle: boolean;
expandableRowDisabled: RowState<T>;
onExpandedRow: (action: ExpandSingleRowAction<T>) => void;
handleExpanded: () => void;
};

function CellExpander<T>({
Expand All @@ -34,6 +35,7 @@ function CellExpander<T>({
keyField,
rowCount,
onExpandedRow,
handleExpanded,
expandableRowsSingle,
expandableRowDisabled,
}: CellExpanderProps<T>): JSX.Element {
Expand All @@ -48,6 +50,7 @@ function CellExpander<T>({
rowCount,
singleExpand: expandableRowsSingle,
});
handleExpanded();
};

return (
Expand Down
1 change: 1 addition & 0 deletions src/DataTable/TableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ function Row<T>({
expandableRowsSingle={expandableRowsSingle}
expandableRowDisabled={expandableRowDisabled}
onExpandedRow={onExpandedRow}
handleExpanded={handleExpanded}
disabled={defaultExpanderDisabled}
/>
);
Expand Down

0 comments on commit 4e56129

Please sign in to comment.