-
Notifications
You must be signed in to change notification settings - Fork 124
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
Fix search sizing on mobile (explore navbar overflow) #1760
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hiding the scrollbar in the navigation bar looks nice, but I'm not sure if it's very accessible.
I agree with you that it looks nice without the scrollbar but I feel that indeed there might be valid concerns about accessibility.
In an extreme case where the navbar has quite a few items and some of them are nicely hidden behind the search box, it might be frustrating for site visitors who then become unaware & unable to find the target nav item.
I think perhaps one way is to explore creating custom css scrollbar which may be more visually appealing.
Or, perhaps we can consider something like what the Github extension that I am using is doing?
|
The issue with using the native scrollbar is that it can differ depending on OS and browser. For example this is how it looks on windows 10 Chrome In this case I would agree with @tlylt to create a custom scrollbar for desktop to keep the design consistent.
I think this is a good idea. We can follow how Github is doing it 👍 |
Just throwing my opinion out here, but I think a native scrollbar is not the best solution, a dropdown like @tlylt and @jonahtanjz |
Hmm, I'm also leaning towards the dropdown (which isn't how github does it but an extension) as opposed to the custom scrollbar. Considering this, I'll edit the description to just fixing the iPad issue? To keep changes separate, would it be possible to merge this first to fix the bug and then I make a separate PR for the dropdown? |
Yep, that sounds good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll edit the description to just fixing the iPad issue? To keep changes separate, would it be possible to merge this first to fix the bug and then I make a separate PR for the dropdown?
Alright sure. Just one suggestion for the implementation of the searchbar.
<style scoped> | ||
.form-control { | ||
min-width: 8em; | ||
} | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can shift the rest of the css rules below to this scoped style as well
I'm not sure if we should move the CSS rules into the scoped style, due to this note on the vue documentation:
Any thoughts? |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaixin-hc, I think we can merge this first while waiting for the discussion on scoped styles.
One last thing, I noticed that by using overflow-x: scroll
on the default navbar, it causes the dropdown to break.
Landing.Page.-.Google.Chrome.2022-02-15.17-18-12.mp4
It may take quite a bit of work to resolve this. Since we are intending to remove scroll for ipad/desktop and use dropdown for overflow, there is not much value in resolving this. We can limit this PR to just the searchbar and remove the changes made for the scrolling :)
Sorry for the delay @jonahtanjz ! I've reverted the changes. I was curious about the scrollbar issue, so I did a little digging for my own learning. After a few stack overflow posts and reading, I found this article: https://css-tricks.com/popping-hidden-overflow/ that explains that setting I think it also shows the need for #1714 |
@all-contributors please add @kaixin-hc for code |
I've put up a pull request to add @kaixin-hc! 🎉 |
@@ -306,7 +306,6 @@ export default { | |||
.navbar-default { | |||
display: block; | |||
margin-top: 0.3125rem; | |||
width: 100%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaixin-hc I believe this is still needed so that the default-navbar
will always go to the next line on mobile :)
Tried with 2 items in the default-navbar
with window width of 700px:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this pull request?
Fixes #1429
Also related: #1699
Overview of changes:
Anything you'd like to highlight / discuss:
Testing instructions:
Add lots of elements to the navigation bar to see it scroll + use google chrome mobile.
Proposed commit message: (wrap lines at 72 characters)
Make navbar scrollable & optimise search input size
Checklist: ☑️