Skip to content

Commit 44f4992

Browse files
fix: disable freezed columns for inner/child table
1 parent 1affeda commit 44f4992

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/DataTable/DataTable.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ function DataTable<T>(props: TableProps<T>): JSX.Element {
123123
footer = defaultProps.footer,
124124
currentSortColumnId = defaultProps.currentSortColumnId,
125125
currentSortDirection = defaultProps.currentSortDirection,
126+
isInnerTable = defaultProps.isInnerTable,
126127
} = props;
127128

128129
const {
@@ -584,12 +585,13 @@ function DataTable<T>(props: TableProps<T>): JSX.Element {
584585
</Wrapper>
585586
</ResponsiveWrapper>
586587

587-
{freezedColumns.length > 0 && (
588+
{!isInnerTable && freezedColumns.length > 0 && (
588589
<div
589590
style={{
590591
position: 'absolute',
591592
top: 0,
592593
left: 0,
594+
maxWidth: '100%',
593595
}}
594596
>
595597
<Table disabled={disabled} className="rdt_Table" role="table">

src/DataTable/defaultProps.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,5 @@ export const defaultProps = {
111111
footer: null,
112112
currentSortColumnId: null,
113113
currentSortDirection: undefined,
114+
isInnerTable: false,
114115
};

src/DataTable/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export type TableProps<T> = {
120120
footer?: React.ReactNode;
121121
currentSortColumnId?: string | number | null;
122122
currentSortDirection?: SortOrder;
123+
isInnerTable?: boolean;
123124
};
124125

125126
export type TableColumnBase = {

0 commit comments

Comments
 (0)