Skip to content

Commit

Permalink
fix: disable freezed columns for inner/child table
Browse files Browse the repository at this point in the history
  • Loading branch information
ravgeetdhillon committed Aug 7, 2024
1 parent 1affeda commit 44f4992
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/DataTable/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ function DataTable<T>(props: TableProps<T>): JSX.Element {
footer = defaultProps.footer,
currentSortColumnId = defaultProps.currentSortColumnId,
currentSortDirection = defaultProps.currentSortDirection,
isInnerTable = defaultProps.isInnerTable,
} = props;

const {
Expand Down Expand Up @@ -584,12 +585,13 @@ function DataTable<T>(props: TableProps<T>): JSX.Element {
</Wrapper>
</ResponsiveWrapper>

{freezedColumns.length > 0 && (
{!isInnerTable && freezedColumns.length > 0 && (
<div
style={{
position: 'absolute',
top: 0,
left: 0,
maxWidth: '100%',
}}
>
<Table disabled={disabled} className="rdt_Table" role="table">
Expand Down
1 change: 1 addition & 0 deletions src/DataTable/defaultProps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,5 @@ export const defaultProps = {
footer: null,
currentSortColumnId: null,
currentSortDirection: undefined,
isInnerTable: false,
};
1 change: 1 addition & 0 deletions src/DataTable/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export type TableProps<T> = {
footer?: React.ReactNode;
currentSortColumnId?: string | number | null;
currentSortDirection?: SortOrder;
isInnerTable?: boolean;
};

export type TableColumnBase = {
Expand Down

0 comments on commit 44f4992

Please sign in to comment.