react-use-scroll-direction
react-use-scroll-direction copied to clipboard
Scrolling to the top in Safari bounces, making isScrollingDown true
In Safari you can scroll further than the top and it then bounces back down, firing an unfortunate isScrollingDown event. Made it difficult to use for showing/hiding a mobile menu.
example: ` useEffect(() => { if (isScrollingDown) { setMinimizeNav(true); }
if (isScrollingUp) {
setMinimizeNav(false);
}
}, [isScrollingUp, isScrollingDown]);`