-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Navigation drawer scroll padding fix #9141
base: main
Are you sure you want to change the base?
Changes from 6 commits
fcdb77c
bd4ea4d
0bb4414
96406ce
3053c12
9eaaa06
c44b5aa
35d3fe9
48c06df
972584a
585c555
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,14 +15,17 @@ import { scrollWrapperScrollTopComponentState } from '@/ui/utilities/scroll/stat | |
import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentStateV2'; | ||
import 'overlayscrollbars/overlayscrollbars.css'; | ||
|
||
const StyledScrollWrapper = styled.div<{ scrollHide?: boolean }>` | ||
const StyledScrollWrapper = styled.div` | ||
display: flex; | ||
height: 100%; | ||
width: 100%; | ||
|
||
.os-scrollbar-handle { | ||
background-color: ${({ theme, scrollHide }) => | ||
scrollHide ? 'transparent' : theme.border.color.medium}; | ||
background-color: ${({ theme }) => theme.border.color.medium}; | ||
} | ||
.os-scrollbar { | ||
padding: 0px; | ||
--os-size: 6px; | ||
} | ||
`; | ||
|
||
|
@@ -36,7 +39,6 @@ export type ScrollWrapperProps = { | |
defaultEnableXScroll?: boolean; | ||
defaultEnableYScroll?: boolean; | ||
contextProviderName: ContextProviderName; | ||
scrollHide?: boolean; | ||
componentInstanceId: string; | ||
}; | ||
|
||
|
@@ -47,7 +49,6 @@ export const ScrollWrapper = ({ | |
defaultEnableXScroll = true, | ||
defaultEnableYScroll = true, | ||
contextProviderName, | ||
scrollHide = false, | ||
}: ScrollWrapperProps) => { | ||
const scrollableRef = useRef<HTMLDivElement>(null); | ||
const Context = getContextByProviderName(contextProviderName); | ||
|
@@ -106,11 +107,7 @@ export const ScrollWrapper = ({ | |
id: contextProviderName, | ||
}} | ||
> | ||
<StyledScrollWrapper | ||
ref={scrollableRef} | ||
className={className} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are we removing the scrollHide? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use scrollHide specifically to hide NavigationDrawer's scroll, but we have new requirements :). We are to show the scroll but with clear paddings |
||
scrollHide={scrollHide} | ||
> | ||
<StyledScrollWrapper ref={scrollableRef} className={className}> | ||
<StyledInnerContainer>{children}</StyledInnerContainer> | ||
</StyledScrollWrapper> | ||
</Context.Provider> | ||
|
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 don't understand all these changes? Looks big changes for a small fix, could you explain it a bit 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.
We can't just remove scrollHide and use the ScrollWrapper in the drawer since it overlaps over the NavigationDrawerItems(for reference #9026), so the idea is to remove the right padding of the NavigationDrawers animated container. And since NavigationDrawerSection controls the width, have an internal wrapper that would minus the width required for the scroll.
Is this the right approach? also, ignore the scroll paddings and widths being changed in ScrollWrapper, I was just trying something out!