question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot scroll down a collapsed navbar on mobile devices

See original GitHub issue

When 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:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:27 (4 by maintainers)

github_iconTop GitHub Comments

18reactions
milossumiccommented, Apr 13, 2018

.navbar-collapse { max-height: calc(100vh - 60px); overflow-y: auto; }

Try this

13reactions
Wruczekcommented, Dec 5, 2018

Fix as of Bootstrap 4.1:

@media (max-width: 991px) {
    .navbar {
        overflow: auto;
        max-height: 85vh;
        align-items: flex-start;
    }
}
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found