DEV Community

Discussion on: Hide menu when scrolling in React.js

Collapse
 
scottdet profile image
scottdet

This works great for me on desktop, however on mobile it's a bit jumpy - does anyone have a solution for this? I was reading this blog: remysharp.com/2012/05/24/issues-wi... which suggests an issue with using 'position: fixed;' inside the scroll element, but the solutions there don't seem to work either.

On mobile, if I scroll too quickly to the top or bottom of the page it seems that pageYOffset picks up some bad values and makes my menu disappear even if I'm scrolling back to the top of the page.