cogsbox-state 0.5.385 → 0.5.386

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.385",
3
+ "version": "0.5.386",
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
@@ -2004,27 +2004,26 @@ function createProxyHandler<T>(
2004
2004
  }
2005
2005
 
2006
2006
  const { scrollTop, scrollHeight, clientHeight } = container;
2007
- console.log(
2008
- "scrollTop, scrollHeight, clientHeight ",
2009
- scrollTop,
2010
- scrollHeight,
2011
- clientHeight
2012
- );
2007
+
2013
2008
  // --- START OF MINIMAL FIX ---
2014
2009
  // This block is the only thing added. It updates the master 'status'.
2015
2010
  // This is the critical missing piece that tells the component if it should auto-scroll.
2016
2011
  // A 10px buffer prevents jittering when you are scrolled to the very bottom.
2017
2012
  const isAtBottom =
2018
2013
  scrollHeight - scrollTop - clientHeight < 10;
2019
- console.log("isAtBottom", isAtBottom);
2014
+
2020
2015
  if (isAtBottom) {
2021
2016
  // If we scroll back to the bottom, re-lock.
2022
2017
  if (status !== "LOCKED_AT_BOTTOM") {
2018
+ console.log("OCKED_AT_BOTTOM");
2019
+ shouldNotScroll.current = false;
2023
2020
  setStatus("LOCKED_AT_BOTTOM");
2024
2021
  }
2025
2022
  } else {
2026
2023
  // If we have scrolled up, unlock from the bottom.
2027
2024
  if (status !== "IDLE_NOT_AT_BOTTOM") {
2025
+ console.log("Scrolled up -> IDLE_NOT_AT_BOTTOM");
2026
+ shouldNotScroll.current = true;
2028
2027
  setStatus("IDLE_NOT_AT_BOTTOM");
2029
2028
  }
2030
2029
  }