Navbar disappears on Safari when scrolled down and then up to the top
See original GitHub issue🐛 Bug Report
Prerequisites
- I’m using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - I have tried creating a repro with https://new.docusaurus.io
- I have read the console error message carefully (if applicable)
Description
Hello, I think this bug is introduced somewhere between canary v0.0.0-4075 and beta v2.0.0-beta.7. On Safari (v15.0 on Big Sur, and also on iOS), when I scroll down, and then scroll back to the top and pull (rubber band animation), the top nabbar no longer visible. Sorry for typing little, hope you can see the embedded screen capture below to infer.
Have you read the Contributing Guidelines on issues?
Yes
Steps to reproduce
Currently, visit https://docusaurus.io/docs using Safari.
Expected behavior
Navbar should stay when scrolled back to the top of the page.
Actual behavior
Navbar not visible.
Your environment
macOS 11.6, Safari 15.0 iOS 14.8
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Why does my toolbar disappear when I scroll up in safari
When in safari and I scroll toward the bottom of the web page, my toolbar and favorites bars disappear until I scroll upwards....
Read more >iPad Safari scrolling causes HTML elements to disappear and ...
BTW I just discovered that on an iPad Air 2, when a specific on-screen element (a navbar, in this case) goes off screen,...
Read more >iOS 10 Safari navbar disappears after opening a <select> menu
go to: https://bootswatch.com/cerulean/ scroll to form and select the select element. The navbar will disappear as long as the iOS Safari ...
Read more >Build a Fixed Top Navigation that Disappears as Users Scroll
Fixed top navigation helps users navigate your site as they go through its content, but the nav takes up precious real estate as...
Read more >Is there a way to keep the bottom back forward bar on Safari ...
Tap the bottom of the browser and it returns...otherwise swipe from off screen to go back. The only thing that annoys me about...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The only step necessary to trigger this behavior is to do a rubber band scrolling.
Seems Safari would treat the “scroll past top” as a negative scroll position while Chrome doesn’t. I tested myself using this:
When opening this HTML file (which is a blank screen) in Chrome, nothing is logged because any scrolling past the page edge will be ignored; on Safari, negative values are logged when scrolling past top, and positive ones when scrolling past bottom.
Thanks, I see now, PR #5721 should fix it.