Fix Filter Bar scrolling (#12156)

This commit is contained in:
Agata Stawarz 2020-12-22 11:09:13 +01:00 committed by GitHub
parent 8682c6fc1c
commit 942e3210b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 4 deletions

View File

@ -73,8 +73,28 @@ export const StickyVerticalBar: React.FC<SVBProps> = ({
<Wrapper className={cx({ open: filtersOpen })}>
<StickyContainer>
<Sticky topOffset={-topOffset} bottomOffset={Infinity}>
{({ style, isSticky }: { style: any; isSticky: boolean }) => (
<Contents style={isSticky ? { ...style, top: topOffset } : null}>
{({
style,
isSticky,
distanceFromTop,
}: {
style: any;
isSticky: boolean;
distanceFromTop: number;
}) => (
<Contents
style={
isSticky
? {
...style,
top: topOffset,
height: `calc(100vh - ${topOffset}px)`,
}
: {
height: `calc(100vh - ${distanceFromTop}px)`,
}
}
>
{children}
</Contents>
)}

View File

@ -61,8 +61,7 @@ const Bar = styled.div`
width: ${barWidth}; // arbitrary...
background: ${({ theme }) => theme.colors.grayscale.light5};
border-right: 1px solid ${({ theme }) => theme.colors.grayscale.light2};
height: 100%;
max-height: 100%;
min-height: 100%;
display: none;
/* &.animated {
display: flex;