Skip to content

Commit

Permalink
fix(AnalyticalTable): Fix overscan count (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusNotheis authored Oct 28, 2019
1 parent 2ae4bf6 commit a975e62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/main/src/components/AnalyticalTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ const AnalyticalTable: FC<TableProps> = forwardRef((props: TableProps, ref: Ref<
isTreeTable={isTreeTable}
internalRowHeight={internalRowHeight}
tableBodyHeight={tableBodyHeight}
visibleRows={visibleRows}
/>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export const VirtualTableBody = (props) => {
resizedColumns,
isTreeTable,
internalRowHeight,
tableBodyHeight
tableBodyHeight,
visibleRows
} = props;

const innerDivRef = useRef(null);
Expand Down Expand Up @@ -76,7 +77,7 @@ export const VirtualTableBody = (props) => {
}, [innerDivRef.current, selectable, classes.tbody, classes.selectable]);

const itemCount = Math.max(minRows, rows.length);
const overscanCount = Math.floor(itemCount / 2);
const overscanCount = Math.floor(visibleRows / 2);

const columnsWidth = useMemo(() => {
const aggregatedWidth = columns
Expand Down

0 comments on commit a975e62

Please sign in to comment.