Skip to content

Commit 168efdb

Browse files
committed
PageLayout: Fixed main content scrollbar
1 parent 31e9394 commit 168efdb

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

client/packages/lowcoder/src/comps/comps/pageLayoutComp/pageLayout.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,18 @@ const getStyle = (style: ContainerStyleType) => {
3939
`;
4040
};
4141

42-
const Wrapper = styled.div<{ $style: ContainerStyleType,$animationStyle:AnimationStyleType }>`
42+
const Wrapper = styled.div<{ $style: ContainerStyleType,$animationStyle:AnimationStyleType, $mainScrollbars: boolean }>`
4343
display: flex;
4444
flex-flow: column;
4545
height: 100%;
4646
border: 1px solid #d7d9e0;
4747
border-radius: 4px;
4848
${(props) => props.$style && getStyle(props.$style)}
4949
${props=>props.$animationStyle}
50+
51+
#pageLayout::-webkit-scrollbar {
52+
display: ${(props) => props.$mainScrollbars ? "block" : "none"};
53+
}
5054
`;
5155

5256
const HeaderInnerGrid = styled(InnerGrid)<{
@@ -156,8 +160,8 @@ export function PageLayout(props: LayoutProps & { siderCollapsed: boolean; setSi
156160
},
157161
}}
158162
>
159-
<Wrapper $style={style} $animationStyle={animationStyle}>
160-
<Layout style={{padding: "0px", overflow: container.mainScrollbars ? "scroll" : "visible"}} hasSider={showSider && !container.innerSider}>
163+
<Wrapper $style={style} $animationStyle={animationStyle} $mainScrollbars={container.mainScrollbars}>
164+
<Layout id="pageLayout" style={{padding: "0px", overflowY: "scroll"}} hasSider={showSider && !container.innerSider}>
161165
{showSider && !container.innerSider && !container.siderRight && (
162166
<><BackgroundColorContext.Provider value={siderStyle?.siderBackground}>
163167
<Sider

client/packages/lowcoder/src/comps/comps/pageLayoutComp/pageLayoutComp.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,11 @@ export class PageLayoutComp extends layoutBaseComp implements IContainer {
159159
return [
160160
this.children.autoHeight.getPropertyView(),
161161
this.children.siderScrollbars.propertyView({ label: trans("prop.siderScrollbar") }),
162-
(!this.children.autoHeight.getView()) && this.children.mainScrollbars.propertyView({ label: trans("prop.mainScrollbar") }),
162+
(!this.children.autoHeight.getView()) && (
163+
!this.children.siderScrollbars.getView() ||
164+
!this.children.contentScrollbars.getView()
165+
) &&
166+
this.children.mainScrollbars.propertyView({ label: trans("prop.mainScrollbar") }),
163167
(!this.children.autoHeight.getView()) && this.children.contentScrollbars.propertyView({ label: trans("prop.showVerticalScrollbar") }),
164168
];
165169
}

0 commit comments

Comments
 (0)