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 visible scrollbar in SideNav when collapsed #1786
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
803d57c
to
c3d0cf0
Compare
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.
OK for me.
One thing I noticed is that in the demo app the scroll bar doesn't jump when re-opening the sidenav (from minimized to expanded) while in the video recording attached to the PR description, in Cloud UI, it jumps (vertically, it seems the content is resized while expanding). Something we should be worried about?
"@hashicorp/design-system-components": patch | ||
--- | ||
|
||
`SideNav` - Fixed visible scrollbar in collapsed SideNav when scroll bar is set to be always visible |
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.
π
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.
Sure thing β added in 4a4a3e3
@@ -16,6 +16,11 @@ | |||
// we use this trick (increasing the container size here, and reducing it at single panel level) | |||
// to have the panels width match the sidebar extended width (it's used in the animated sliding of the panels) | |||
margin: 0 calc(var(--token-side-nav-wrapper-padding-horizontal) * -1); | |||
|
|||
.hds-side-nav--is-minimized & { |
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 would add a comment here, explaining what is going on and why we need this "hack"
It can happen in the demo app as well, it's related to the size of content in |
db23c3d
to
734b5b9
Compare
packages/components/app/styles/components/side-nav/content.scss
Outdated
Show resolved
Hide resolved
packages/components/app/styles/components/side-nav/content.scss
Outdated
Show resolved
Hide resolved
734b5b9
to
19bc91f
Compare
π Summary
Fix visible scrollbar in
SideNav
when collapsed and the scroll bar is set to be always visible.π οΈ Detailed description
When set to be always visible at the OS level or an external mouse or trackpad is used, the scroll bars are always displayed. This is aesthetically unpleasant so we prevent this scroll from being visible by hiding the
hds-side-nav__content
when the SideBar is minimized. This change was tested locally incloud-ui
andatlas
.Note: the demo app commit was added to ease the review, the commit will be removed before merging.
πΈ Screenshots
In demo app, with scrollbar set to always be visible
In
cloud-ui
with slowed down animation and scrollbar set to always be visiblesidenav-scroll-before.mp4
sidenav-scroll-after.mp4
π External links
Jira ticket: HDS-2853
Slack thread
π Component checklist
yarn test:a11y --filter="COMPONENT-NAME"
)a11yAudit
has been added㪠Please consider using conventional comments when reviewing this PR.