cogsbox-state 0.5.361 → 0.5.362
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CogsState.jsx +244 -244
- package/dist/CogsState.jsx.map +1 -1
- package/package.json +1 -1
- package/src/CogsState.tsx +9 -5
package/package.json
CHANGED
package/src/CogsState.tsx
CHANGED
|
@@ -1971,10 +1971,14 @@ function createProxyHandler<T>(
|
|
|
1971
1971
|
) {
|
|
1972
1972
|
endIndex++;
|
|
1973
1973
|
}
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1974
|
+
const newEndIndex = Math.min(totalCount, endIndex + overscan);
|
|
1975
|
+
|
|
1976
|
+
// --- LOGGING ADDED HERE ---
|
|
1977
|
+
console.log(
|
|
1978
|
+
`RANGE UPDATE: Start: ${startIndex}, End: ${newEndIndex}, Total: ${totalCount}`
|
|
1979
|
+
);
|
|
1980
|
+
|
|
1981
|
+
setRange({ startIndex, endIndex: newEndIndex });
|
|
1978
1982
|
};
|
|
1979
1983
|
|
|
1980
1984
|
const handleUserScroll = () => {
|
|
@@ -1997,7 +2001,7 @@ function createProxyHandler<T>(
|
|
|
1997
2001
|
|
|
1998
2002
|
return () =>
|
|
1999
2003
|
container.removeEventListener("scroll", handleUserScroll);
|
|
2000
|
-
}, [...dependencies]);
|
|
2004
|
+
}, [...dependencies, totalCount, positions]); // <--- THE FIX
|
|
2001
2005
|
|
|
2002
2006
|
const scrollToBottom = useCallback(
|
|
2003
2007
|
(behavior: ScrollBehavior = "smooth") => {
|