@@ -123,7 +123,7 @@ function DataTable<T>(props: TableProps<T>): JSX.Element {
123
123
footer = defaultProps . footer ,
124
124
currentSortColumnId = defaultProps . currentSortColumnId ,
125
125
currentSortDirection = defaultProps . currentSortDirection ,
126
- // isInnerTable = defaultProps.isInnerTable,
126
+ isInnerTable = defaultProps . isInnerTable ,
127
127
} = props ;
128
128
129
129
const {
@@ -139,16 +139,16 @@ function DataTable<T>(props: TableProps<T>): JSX.Element {
139
139
} = useColumns ( columns , onColumnOrderChange , defaultSortFieldId , defaultSortAsc ) ;
140
140
141
141
// 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
- // );
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
152
153
153
// const tableColumnsBasedOnTable = React.useMemo(() => {
154
154
// if (!isInnerTable) {
@@ -157,9 +157,9 @@ function DataTable<T>(props: TableProps<T>): JSX.Element {
157
157
// return tableColumns.slice(0, index);
158
158
// }, [index, isInnerTable, tableColumns]);
159
159
160
- // const freezedColumns = React.useMemo(() => {
161
- // return tableColumns.slice(0, index);
162
- // }, [index, tableColumns]);
160
+ const freezedColumns = React . useMemo ( ( ) => {
161
+ return tableColumns . slice ( 0 , index ) ;
162
+ } , [ index , tableColumns ] ) ;
163
163
164
164
const [
165
165
{
@@ -597,13 +597,14 @@ function DataTable<T>(props: TableProps<T>): JSX.Element {
597
597
</ Wrapper >
598
598
</ ResponsiveWrapper >
599
599
600
- { /* { freezedColumns.length > 0 && (
600
+ { ! expandableRows && ! isInnerTable && freezedColumns . length > 0 && (
601
601
< div
602
602
style = { {
603
603
position : 'absolute' ,
604
- top: '200px' ,
604
+ top : 0 ,
605
605
left : 0 ,
606
606
maxWidth : '100%' ,
607
+ border : '1px solid black' ,
607
608
} }
608
609
>
609
610
< Table disabled = { disabled } className = "rdt_Table" role = "table" >
@@ -715,7 +716,7 @@ function DataTable<T>(props: TableProps<T>): JSX.Element {
715
716
</ Table >
716
717
{ footer && < div > { footer } </ div > }
717
718
</ div >
718
- )} */ }
719
+ ) }
719
720
</ div >
720
721
721
722
{ enabledPagination && (
0 commit comments