Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix useScroll throttling

dominik-zeglenae3fe9002fc4
diff --git a/saleor/static/dashboard-next/hooks/useScroll.ts b/saleor/static/dashboard-next/hooks/useScroll.ts
index 771966ee50..355ae5e5e8 100644
--- a/saleor/static/dashboard-next/hooks/useScroll.ts
+++ b/saleor/static/dashboard-next/hooks/useScroll.ts
@@ -1,5 +1,5 @@
// tslint:disable:no-submodule-imports
-import throttle from "lodash/throttle";
+import * as throttle from "lodash/throttle";
import { useEffect, useState } from "react";
function getPosition() {
@@ -13,7 +13,7 @@ function useScroll() {
const [scroll, setScroll] = useState(getPosition);
useEffect(() => {
- const handleScroll = () => throttle(setScroll(getPosition()), 100);
+ const handleScroll = throttle(() => setScroll(getPosition()), 250);
window.addEventListener("scroll", handleScroll);