Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/main/src/components/AnalyticalTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ const AnalyticalTable = forwardRef<AnalyticalTableDomRef, AnalyticalTablePropTyp
} = props;

useStylesheet(styleData, AnalyticalTable.displayName);
const isInitial = useRef(false);

useEffect(() => {
if (props.alwaysShowSubComponent != undefined) {
Expand Down Expand Up @@ -308,6 +309,15 @@ const AnalyticalTable = forwardRef<AnalyticalTableDomRef, AnalyticalTablePropTyp
// necessary as otherwise values are rounded which leads to wrong total width calculation leading to unnecessary scrollbar
measureElement: !scaleXFactor || scaleXFactor === 1 ? (el) => 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) {
Expand Down
Loading