@ludo.ninja/components 2.1.27 → 2.1.28

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.
@@ -62,7 +62,7 @@ const ToTopBtnIconResize = () => {
62
62
  };
63
63
  const ToTopBtn = () => {
64
64
  const [showBtn, setShowBtn] = (0, react_1.useState)(false);
65
- let oldScrollY = document.documentElement.scrollTop;
65
+ // let oldScrollY = document.documentElement.scrollTop;
66
66
  const offsetPixels = 600;
67
67
  (0, react_1.useEffect)(() => {
68
68
  window.addEventListener('scroll', handleScroll);
@@ -73,14 +73,14 @@ const ToTopBtn = () => {
73
73
  };
74
74
  const handleScroll = () => {
75
75
  if ((0, ui_1.upBtnDistance)(document, offsetPixels)) {
76
- if (oldScrollY > document.documentElement.scrollTop) {
77
- setShowBtn(true);
78
- }
79
- oldScrollY = document.documentElement.scrollTop;
76
+ // if (oldScrollY > document.documentElement.scrollTop) {
77
+ setShowBtn(true);
78
+ // }
79
+ // oldScrollY = document.documentElement.scrollTop;
80
80
  }
81
81
  else {
82
82
  setShowBtn(false);
83
- oldScrollY = offsetPixels;
83
+ // oldScrollY = offsetPixels;
84
84
  }
85
85
  };
86
86
  if (!showBtn)
@@ -6,20 +6,20 @@ const react_1 = require("react");
6
6
  const toTopBtn_1 = require("../../components/toTopBtn");
7
7
  const useVirtuosoToTopBtnInitialize = () => {
8
8
  const [isShowBtn, setIsShowBtn] = (0, react_1.useState)(false);
9
- const oldScrollY = (0, react_1.useRef)(0);
9
+ // const oldScrollY = useRef(0);
10
10
  const offsetPixels = 600;
11
11
  return {
12
12
  isShowBtn,
13
13
  onScroll(scrollY) {
14
14
  if (scrollY > offsetPixels) {
15
- if (oldScrollY.current > scrollY) {
16
- setIsShowBtn(true);
17
- }
18
- oldScrollY.current = scrollY;
15
+ // if (oldScrollY.current > scrollY) {
16
+ setIsShowBtn(true);
17
+ // }
18
+ // oldScrollY.current = scrollY;
19
19
  }
20
20
  else {
21
21
  setIsShowBtn(false);
22
- oldScrollY.current = offsetPixels;
22
+ // oldScrollY.current = offsetPixels;
23
23
  }
24
24
  },
25
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "2.1.27",
3
+ "version": "2.1.28",
4
4
  "private": false,
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",