diff --git a/packages/main/src/components/AnalyticalTable/index.tsx b/packages/main/src/components/AnalyticalTable/index.tsx index e721df12090..d3bc6fa46e8 100644 --- a/packages/main/src/components/AnalyticalTable/index.tsx +++ b/packages/main/src/components/AnalyticalTable/index.tsx @@ -163,6 +163,7 @@ const AnalyticalTable = forwardRef el.getBoundingClientRect().width : undefined }); + // force re-measure if `visibleColumns` change + useEffect(() => { + if (isInitial.current && visibleColumns.length) { + columnVirtualizer.measure(); + } else { + isInitial.current = true; + } + }, [visibleColumns.length]); + const [analyticalTableRef, scrollToRef] = useTableScrollHandles(updatedRef, dispatch); if (parentRef.current) {