@@ -224,8 +224,10 @@ const AnalyticalTable: FC<TableProps> = forwardRef((props: TableProps, ref: Ref<
224
224
) ;
225
225
226
226
const updateTableSizes = useCallback ( ( ) => {
227
- const visibleColumns = columns . filter ( Boolean ) . filter ( ( { show } ) => show ?? true ) ;
228
- const columnsWithFixedWidth = columns
227
+ const visibleColumns = columns . filter ( Boolean ) . filter ( ( item ) => {
228
+ return ( item . isVisible ?? true ) && ! tableState . hiddenColumns . includes ( item . accessor ) ;
229
+ } ) ;
230
+ const columnsWithFixedWidth = visibleColumns
229
231
. filter ( ( { width, minWidth } ) => width ?? minWidth ?? false )
230
232
. map ( ( { width, minWidth } ) => width ?? minWidth ) ;
231
233
const fixedWidth = columnsWithFixedWidth . reduce ( ( acc , val ) => acc + val , 0 ) ;
@@ -236,7 +238,7 @@ const AnalyticalTable: FC<TableProps> = forwardRef((props: TableProps, ref: Ref<
236
238
} else {
237
239
setColumnWidth ( 150 ) ;
238
240
}
239
- } , [ tableRef . current , columns ] ) ;
241
+ } , [ tableRef . current , columns , tableState . hiddenColumns ] ) ;
240
242
241
243
useEffect ( ( ) => {
242
244
updateTableSizes ( ) ;
@@ -349,7 +351,10 @@ const AnalyticalTable: FC<TableProps> = forwardRef((props: TableProps, ref: Ref<
349
351
{ loading && busyIndicatorEnabled && data . length > 0 && < LoadingComponent /> }
350
352
{ loading && data . length === 0 && (
351
353
< TablePlaceholder
352
- columns = { columns . filter ( ( col ) => col . show ?? true ) . length }
354
+ columns = {
355
+ columns . filter ( ( col ) => ( col . isVisible ?? true ) && ! tableState . hiddenColumns . includes ( col . accessor ) )
356
+ . length
357
+ }
353
358
rows = { props . minRows }
354
359
style = { noDataStyles }
355
360
rowHeight = { internalRowHeight }
0 commit comments