updates on the scroll fix
This commit is contained in:
@@ -445,9 +445,11 @@ export default function OrdersDetails() {
|
||||
}
|
||||
},
|
||||
{
|
||||
root: document.querySelector('.MuiTableContainer-root'),
|
||||
rootMargin: '0px',
|
||||
threshold: 1.0
|
||||
// The page (viewport) is now the scroll container, not the table.
|
||||
// Prefetch the next page ~400px before the sentinel reaches the bottom.
|
||||
root: null,
|
||||
rootMargin: '0px 0px 400px 0px',
|
||||
threshold: 0
|
||||
}
|
||||
);
|
||||
if (loadMoreRef.current) observer.observe(loadMoreRef.current);
|
||||
@@ -1033,11 +1035,12 @@ export default function OrdersDetails() {
|
||||
ref={containerRef}
|
||||
onScroll={handleScroll}
|
||||
sx={{
|
||||
// After compacting header + KPIs + filter bar, ~300px of chrome is reserved.
|
||||
// The table now claims everything else so operators see many more rows at once.
|
||||
minHeight: 320,
|
||||
maxHeight: { xs: 'calc(100vh - 320px)', md: 'calc(100vh - 300px)' },
|
||||
overflow: 'auto',
|
||||
// Single page scroll: the table is NOT height-capped, so it renders at its
|
||||
// full height and the whole page scrolls as one. Scrolling down moves the
|
||||
// KPI cards + header + filter bar off-screen and reveals the full table.
|
||||
// Only horizontal overflow scrolls inside the container (for wide column sets).
|
||||
overflowX: 'auto',
|
||||
overflowY: 'visible',
|
||||
'&::-webkit-scrollbar': { width: 10, height: 10 },
|
||||
'&::-webkit-scrollbar-thumb': {
|
||||
backgroundColor: edge(BRAND),
|
||||
|
||||
Reference in New Issue
Block a user