Skip to content

Commit ce95747

Browse files
authored
refactor: remove maxContentScroll prop and related logic from FixedHolder and Table components (#1317)
1 parent 8fd0790 commit ce95747

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

src/FixedHolder/index.tsx

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ function useColumnWidth(colWidths: readonly number[], columCount: number) {
2727
export interface FixedHeaderProps<RecordType> extends HeaderProps<RecordType> {
2828
className: string;
2929
noData: boolean;
30-
maxContentScroll: boolean;
3130
colWidths: readonly number[];
3231
columCount: number;
3332
direction: Direction;
@@ -58,7 +57,6 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<any>>((pro
5857
stickyBottomOffset,
5958
stickyClassName,
6059
onScroll,
61-
maxContentScroll,
6260
children,
6361
...restProps
6462
} = props;
@@ -98,12 +96,6 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<any>>((pro
9896
};
9997
}, []);
10098

101-
// Check if all flattenColumns has width
102-
const allFlattenColumnsWithWidth = React.useMemo(
103-
() => flattenColumns.every(column => column.width),
104-
[flattenColumns],
105-
);
106-
10799
// Add scrollbar column
108100
const lastColumn = flattenColumns[flattenColumns.length - 1];
109101
const ScrollBarColumn: ColumnType<unknown> & { scrollbar: true } = {
@@ -156,13 +148,11 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<any>>((pro
156148
visibility: noData || mergedColumnWidth ? null : 'hidden',
157149
}}
158150
>
159-
{(!noData || !maxContentScroll || allFlattenColumnsWithWidth) && (
160-
<ColGroup
161-
colWidths={mergedColumnWidth ? [...mergedColumnWidth, combinationScrollBarSize] : []}
162-
columCount={columCount + 1}
163-
columns={flattenColumnsWithScrollbar}
164-
/>
165-
)}
151+
<ColGroup
152+
colWidths={mergedColumnWidth ? [...mergedColumnWidth, combinationScrollBarSize] : []}
153+
columCount={columCount + 1}
154+
columns={flattenColumnsWithScrollbar}
155+
/>
166156
{children({
167157
...restProps,
168158
stickyOffsets: headerStickyOffsets,

src/Table.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,6 @@ function Table<RecordType extends DefaultRecordType>(
680680
// Fixed holder share the props
681681
const fixedHolderProps = {
682682
noData: !mergedData.length,
683-
maxContentScroll: horizonScroll && mergedScrollX === 'max-content',
684683
...headerProps,
685684
...columnContext,
686685
direction,

0 commit comments

Comments
 (0)