We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 45b0282 + 9b818b3 commit ab78991Copy full SHA for ab78991
demos/react/src/virtualized/VirtualTable.tsx
@@ -70,7 +70,10 @@ function VirtualTableBase<T>({
70
return offset;
71
}
72
const scrollTop = viewport.scrollTop;
73
- const newPage = Math.floor(scrollTop * ((th - vp) / (h - vp)) * (1 / ph));
+ const newPage = Math.max(
74
+ Math.floor(scrollTop * ((th - vp) / (h - vp)) * (1 / ph)),
75
+ 0
76
+ );
77
setPage(newPage);
78
const nextOffset = Math.round(newPage * cj);
79
setOffset(nextOffset);
@@ -83,7 +86,7 @@ function VirtualTableBase<T>({
83
86
if (!viewport) {
84
87
85
88
- const scrollTop = viewport.scrollTop;
89
+ const scrollTop = Math.max(viewport.scrollTop, 0);
90
91
// next page
92
let nextOffset = offset;
0 commit comments