cogsbox-state 0.5.371 → 0.5.373
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 +237 -237
- package/dist/CogsState.jsx.map +1 -1
- package/package.json +1 -1
- package/src/CogsState.tsx +24 -21
package/package.json
CHANGED
package/src/CogsState.tsx
CHANGED
|
@@ -1949,16 +1949,16 @@ function createProxyHandler<T>(
|
|
|
1949
1949
|
|
|
1950
1950
|
if (lastItemHeight > 0) {
|
|
1951
1951
|
clearInterval(intervalId);
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1952
|
+
if (!shouldNotScroll.current) {
|
|
1953
|
+
console.log(
|
|
1954
|
+
"ACTION (GETTING_HEIGHTS): Measurement success -> SCROLLING_TO_BOTTOM"
|
|
1955
|
+
);
|
|
1956
|
+
|
|
1957
|
+
setStatus("SCROLLING_TO_BOTTOM");
|
|
1958
|
+
}
|
|
1956
1959
|
}
|
|
1957
1960
|
}, 100);
|
|
1958
|
-
} else if (
|
|
1959
|
-
status === "SCROLLING_TO_BOTTOM" &&
|
|
1960
|
-
!shouldNotScroll.current
|
|
1961
|
-
) {
|
|
1961
|
+
} else if (status === "SCROLLING_TO_BOTTOM") {
|
|
1962
1962
|
console.log(
|
|
1963
1963
|
"ACTION (SCROLLING_TO_BOTTOM): Executing scroll."
|
|
1964
1964
|
);
|
|
@@ -2000,20 +2000,23 @@ function createProxyHandler<T>(
|
|
|
2000
2000
|
|
|
2001
2001
|
const handleUserScroll = () => {
|
|
2002
2002
|
// This is the core logic you wanted.
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2003
|
+
|
|
2004
|
+
const isAtBottom =
|
|
2005
|
+
container.scrollHeight -
|
|
2006
|
+
container.scrollTop -
|
|
2007
|
+
container.clientHeight <
|
|
2008
|
+
1;
|
|
2009
|
+
|
|
2010
|
+
if (!isAtBottom) {
|
|
2011
|
+
console.log(
|
|
2012
|
+
"USER ACTION: Scrolled up -> IDLE_NOT_AT_BOTTOM"
|
|
2013
|
+
);
|
|
2014
|
+
shouldNotScroll.current = true;
|
|
2015
|
+
setStatus("IDLE_NOT_AT_BOTTOM");
|
|
2016
|
+
} else {
|
|
2017
|
+
shouldNotScroll.current = false;
|
|
2016
2018
|
}
|
|
2019
|
+
|
|
2017
2020
|
// We always update the range, regardless of state.
|
|
2018
2021
|
// This is the full, non-placeholder function.
|
|
2019
2022
|
const { scrollTop, clientHeight } = container;
|