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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cogsbox-state",
3
- "version": "0.5.361",
3
+ "version": "0.5.362",
4
4
  "description": "React state management library with form controls and server sync",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/CogsState.tsx CHANGED
@@ -1971,10 +1971,14 @@ function createProxyHandler<T>(
1971
1971
  ) {
1972
1972
  endIndex++;
1973
1973
  }
1974
- setRange({
1975
- startIndex,
1976
- endIndex: Math.min(totalCount, endIndex + overscan),
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") => {