cogsbox-state 0.5.408 → 0.5.410
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 +218 -221
- package/dist/CogsState.jsx.map +1 -1
- package/package.json +1 -1
- package/src/CogsState.tsx +9 -16
package/package.json
CHANGED
package/src/CogsState.tsx
CHANGED
|
@@ -1925,27 +1925,20 @@ function createProxyHandler<T>(
|
|
|
1925
1925
|
const { scrollTop, scrollHeight, clientHeight } = container;
|
|
1926
1926
|
const currentBottom = scrollTop + clientHeight;
|
|
1927
1927
|
const actualBottom = scrollHeight;
|
|
1928
|
-
const isAtBottom = actualBottom - currentBottom <
|
|
1928
|
+
const isAtBottom = actualBottom - currentBottom < 10; // Increased tolerance
|
|
1929
1929
|
|
|
1930
1930
|
if (isAtBottom || attempts >= maxAttempts) {
|
|
1931
1931
|
clearInterval(scrollToBottomIntervalRef.current!);
|
|
1932
1932
|
scrollToBottomIntervalRef.current = null;
|
|
1933
|
-
|
|
1934
|
-
// Do one final scroll to ensure we're truly at bottom
|
|
1935
|
-
if (
|
|
1936
|
-
isAtBottom &&
|
|
1937
|
-
container.scrollTop <
|
|
1938
|
-
container.scrollHeight - container.clientHeight
|
|
1939
|
-
) {
|
|
1940
|
-
container.scrollTop = container.scrollHeight;
|
|
1941
|
-
}
|
|
1942
1933
|
} else {
|
|
1943
|
-
//
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1934
|
+
// Set flag before scrolling
|
|
1935
|
+
isProgrammaticScrollRef.current = true;
|
|
1936
|
+
container.scrollTop = container.scrollHeight;
|
|
1937
|
+
|
|
1938
|
+
// Reset flag after a short delay
|
|
1939
|
+
setTimeout(() => {
|
|
1940
|
+
isProgrammaticScrollRef.current = false;
|
|
1941
|
+
}, 50);
|
|
1949
1942
|
}
|
|
1950
1943
|
}, 100);
|
|
1951
1944
|
|