Cannot scroll down a collapsed navbar on mobile devices
See original GitHub issueWhen visiting a site using a mobile device with a navbar with .fixed-top, if the opened navbar-collapse area runs beyond the end on the viewport vertically (due to lots of links etc), you cannot scroll down the the links at the bottom of the navbar as you can in Bootstrap 3.
When you do try to scroll, the body behind the navbar scrolls, with the navbar fixed in place.
This can be fixed by setting overflow-y: auto;
and adding a max-height:Xpx
to the .collapse.show
class and allows you to scroll the navbar-collapse area.
This happens in (the ones I tested) major browsers (Safari, Chrome, both on the latest updates). I haven’t yet tried whether this fix breaks anything elsewhere.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:27 (4 by maintainers)
Top Results From Across the Web
Bootstrap 3: opened navbar's content can't scroll on mobile
On my Lumia 820 I checked out the default navbar but I can't scroll the content of the menu inside the navbar. Instead...
Read more >Bootstrap 4 - Fixed & collapsed navbar not scrollable fix.
This example is a quick exercise to illustrate how fixed to top navbar works. As you scroll, it will remain fixed to the...
Read more >Navbar · Bootstrap v5.1
.collapse.navbar-collapse for grouping and hiding navbar contents by a parent breakpoint. Add an optional .navbar-scroll to set a max-height and scroll expanded ...
Read more >overscroll-behavior - CSS: Cascading Style Sheets | MDN
... this property cannot be used to stop scroll chaining for iframes. ... bottom (e.g. Chrome on Android refreshes the page when you...
Read more >Collapse not working bootstrap 4. To enable the collapse ...
Cannot scroll down a collapsed navbar on mobile devices · Issue #23374 · twbs/bootstrap · GitHub twbs bootstrap Public Code Discussions Actions Projects ......
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
.navbar-collapse { max-height: calc(100vh - 60px); overflow-y: auto; }
Try this
Fix as of Bootstrap 4.1: