We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 605c7fa commit 6a1b52eCopy full SHA for 6a1b52e
src/components/react/ScrollToTop.tsx
@@ -51,12 +51,13 @@ const ScrollToTop: React.FC<Props> = ({ children }) => {
51
});
52
53
if (linkRef.current) {
54
- isAtTop || isAtBottom ? hideLink(linkRef) : showLink(linkRef);
+ if (isAtTop || isAtBottom) hideLink(linkRef);
55
+ else showLink(linkRef);
56
}
57
};
58
- // bellow 200 or it will break again
59
- const debouncedCallback = debounce(callback, 100);
+ // bellow 100 or it will break again on fast scroll
60
+ const debouncedCallback = debounce(callback, 20);
61
const intersect = new IntersectionObserver(debouncedCallback);
62
63
if (topRef.current) intersect.observe(topRef.current);
0 commit comments