Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .navbar-nav-scroll for vertical scrolling of navbar content #32037

Merged
merged 7 commits into from
Jan 19, 2021

Conversation

mdo
Copy link
Member

@mdo mdo commented Nov 1, 2020

@mdo mdo changed the title Test out a .navbar-nav-scroll class Add .navbar-nav-scroll for vertical scrolling of navbar content Nov 1, 2020
@patrickhlauke
Copy link
Member

patrickhlauke commented Nov 9, 2020

nitpick ... not just vertical scrolling, but horizontal scrolling as well, no? i.e. despite targetting only the y axis, the mere presence of overflow-y seems to also lead to that horizontal scrollbar in larger (non-collapsed) nav?

@ffoodd
Copy link
Member

ffoodd commented Nov 23, 2020

Just a suggestion here: couldn't we use the scrolling shadow trick by Lea Verou here?

Would help to get a visual clue of overflown things.

And maybe some scroll-snap-* love too? Don't have a concrete idea but there's probably something to do.

@patrickhlauke
Copy link
Member

Just a suggestion here: couldn't we use the scrolling shadow trick by Lea Verou here?

Would help to get a visual clue of overflown things.

And maybe some scroll-snap-* love too? Don't have a concrete idea but there's probably something to do.

i'd suggest a new ticket for this. and agree, would be good to provide a visual hint that there's more that can be reached with scrolling (for platforms where the scrollbar is not shown, like mobile). maybe not a shadow, but perhaps a subtle arrow or similar if that's still possible to do with pure CSS

@mdo mdo marked this pull request as ready for review January 10, 2021 01:48
@mdo mdo requested a review from a team as a code owner January 10, 2021 01:48
@mdo
Copy link
Member Author

mdo commented Jan 10, 2021

Rebased and updated this PR to prevent the horizontal scrolling issue on expanded navbars. Also documented the potential issue with using overflow-y and clipping through overflow-x being automatically set by browsers. I think this is good to go and could be nice to include in both v5 and v4.6.

Can y'all take another look?

@XhmikosR
Copy link
Member

@mdo it seems there are still overflow in certain display widths

image

But it seems to affect the other snippets too. That being said, I'm having trouble visualizing the scroll part here; I don't see the ability to horizontally scroll at all.

@ffoodd
Copy link
Member

ffoodd commented Jan 11, 2021

Like @XhmikosR said, even duplicating some nav items it still overflows horizontally. Am I missing something?

@mdo
Copy link
Member Author

mdo commented Jan 11, 2021

That being said, I'm having trouble visualizing the scroll part here; I don't see the ability to horizontally scroll at all.

This is for vertical scroll, not horizontal. On the expanded navbars (that is to say, the horizontal ones) the intent is that you don't see anything different than other navbars. Resetting to overflow visible might not be the right move though (maybe unset or initial?), but I was aiming for something that can be backported to v4.

@XhmikosR
Copy link
Member

TBH I'm not sure about the feature itself, but if you all think it's something useful, that's fine.

BTW the scrollbar seems to overlap here with the button (FF on Windows x64)

image

@mdo
Copy link
Member Author

mdo commented Jan 19, 2021

Scrollbar only overlapped the button focus, but I've tweaked the demo to prevent that. Also updated the docs verbiage a bit, so should be good to go now.

@XhmikosR XhmikosR added the v4 label Jan 19, 2021
@XhmikosR XhmikosR merged commit 40b15de into main Jan 19, 2021
@XhmikosR XhmikosR deleted the navbar-scroll branch January 19, 2021 05:32
XhmikosR added a commit that referenced this pull request Jan 19, 2021
Add `.navbar-nav-scroll` for vertical scrolling of navbar content
XhmikosR added a commit that referenced this pull request Jan 19, 2021
Add `.navbar-nav-scroll` for vertical scrolling of navbar content
XhmikosR added a commit that referenced this pull request Jan 19, 2021
* Backport #32037

Add `.navbar-nav-scroll` for vertical scrolling of navbar content

* drop the css var for a Sass css

Co-authored-by: Mark Otto <[email protected]>
@baszero
Copy link

baszero commented Jun 3, 2022

Is this available in Bootstrap 4.5 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot scroll down a collapsed navbar on mobile devices
5 participants