cogsbox-state 0.5.338 → 0.5.339

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.338",
3
+ "version": "0.5.339",
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
@@ -1871,29 +1871,29 @@ function createProxyHandler<T>(
1871
1871
  validIndices,
1872
1872
  });
1873
1873
  }, [range.startIndex, range.endIndex, sourceArray, totalCount]);
1874
- useEffect(() => {
1875
- if (stickToBottom && totalCount > 0 && containerRef.current) {
1876
- // When count increases, immediately adjust range to show bottom
1877
- const container = containerRef.current;
1878
- const visibleCount = Math.ceil(
1879
- container.clientHeight / itemHeight
1880
- );
1881
-
1882
- // Set range to show the last items including the new one
1883
- setRange({
1884
- startIndex: Math.max(
1885
- 0,
1886
- totalCount - visibleCount - overscan
1887
- ),
1888
- endIndex: totalCount,
1889
- });
1890
-
1891
- // Then scroll to bottom after a short delay
1892
- setTimeout(() => {
1893
- container.scrollTop = container.scrollHeight;
1894
- }, 100);
1895
- }
1896
- }, [totalCount]);
1874
+ // useEffect(() => {
1875
+ // if (stickToBottom && totalCount > 0 && containerRef.current) {
1876
+ // // When count increases, immediately adjust range to show bottom
1877
+ // const container = containerRef.current;
1878
+ // const visibleCount = Math.ceil(
1879
+ // container.clientHeight / itemHeight
1880
+ // );
1881
+
1882
+ // // Set range to show the last items including the new one
1883
+ // setRange({
1884
+ // startIndex: Math.max(
1885
+ // 0,
1886
+ // totalCount - visibleCount - overscan
1887
+ // ),
1888
+ // endIndex: totalCount,
1889
+ // });
1890
+
1891
+ // // Then scroll to bottom after a short delay
1892
+ // setTimeout(() => {
1893
+ // container.scrollTop = container.scrollHeight + 9999;
1894
+ // }, 200);
1895
+ // }
1896
+ // }, [totalCount]);
1897
1897
  // This is the main effect that handles all scrolling and updates.
1898
1898
  useLayoutEffect(() => {
1899
1899
  const container = containerRef.current;
@@ -1905,7 +1905,7 @@ function createProxyHandler<T>(
1905
1905
  container.scrollHeight -
1906
1906
  container.scrollTop -
1907
1907
  container.clientHeight <
1908
- 1;
1908
+ itemHeight;
1909
1909
 
1910
1910
  // This function determines what's visible in the viewport.
1911
1911
  const updateVirtualRange = () => {