Skip to content

Commit cace3e7

Browse files
committedAug 8, 2024
revert: revert freezed columns changes
1 parent 4d5cd1d commit cace3e7

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed
 

‎src/DataTable/DataTable.tsx

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +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,
126+
// isInnerTable = defaultProps.isInnerTable,
127127
} = props;
128128

129129
const {
@@ -139,27 +139,27 @@ function DataTable<T>(props: TableProps<T>): JSX.Element {
139139
} = useColumns(columns, onColumnOrderChange, defaultSortFieldId, defaultSortAsc);
140140

141141
// Find index of last freezed column
142-
const index = React.useMemo(
143-
() =>
144-
tableColumns.reduce((i, column) => {
145-
if (column.freeze) {
146-
i += 1;
147-
}
148-
return i;
149-
}, 0),
150-
[tableColumns],
151-
);
152-
153-
const tableColumnsBasedOnTable = React.useMemo(() => {
154-
if (!isInnerTable) {
155-
return tableColumns;
156-
}
157-
return tableColumns.slice(0, index);
158-
}, [index, isInnerTable, tableColumns]);
159-
160-
const freezedColumns = React.useMemo(() => {
161-
return tableColumns.slice(0, index);
162-
}, [index, tableColumns]);
142+
// const index = React.useMemo(
143+
// () =>
144+
// tableColumns.reduce((i, column) => {
145+
// if (column.freeze) {
146+
// i += 1;
147+
// }
148+
// return i;
149+
// }, 0),
150+
// [tableColumns],
151+
// );
152+
153+
// const tableColumnsBasedOnTable = React.useMemo(() => {
154+
// if (!isInnerTable) {
155+
// return tableColumns;
156+
// }
157+
// return tableColumns.slice(0, index);
158+
// }, [index, isInnerTable, tableColumns]);
159+
160+
// const freezedColumns = React.useMemo(() => {
161+
// return tableColumns.slice(0, index);
162+
// }, [index, tableColumns]);
163163

164164
const [
165165
{
@@ -498,7 +498,7 @@ function DataTable<T>(props: TableProps<T>): JSX.Element {
498498
</>
499499
)}
500500

501-
{tableColumnsBasedOnTable.map(column => (
501+
{tableColumns.map(column => (
502502
<Column
503503
key={column.id}
504504
column={column}
@@ -546,7 +546,7 @@ function DataTable<T>(props: TableProps<T>): JSX.Element {
546546
key={id}
547547
keyField={keyField}
548548
data-row-id={id}
549-
columns={tableColumnsBasedOnTable}
549+
columns={tableColumns}
550550
row={row}
551551
rowCount={sortedData.length}
552552
rowIndex={i}
@@ -597,11 +597,11 @@ function DataTable<T>(props: TableProps<T>): JSX.Element {
597597
</Wrapper>
598598
</ResponsiveWrapper>
599599

600-
{freezedColumns.length > 0 && (
600+
{/* {freezedColumns.length > 0 && (
601601
<div
602602
style={{
603603
position: 'absolute',
604-
top: 0,
604+
top: '200px',
605605
left: 0,
606606
maxWidth: '100%',
607607
}}
@@ -715,7 +715,7 @@ function DataTable<T>(props: TableProps<T>): JSX.Element {
715715
</Table>
716716
{footer && <div>{footer}</div>}
717717
</div>
718-
)}
718+
)} */}
719719
</div>
720720

721721
{enabledPagination && (

0 commit comments

Comments
 (0)