Skip to content

Commit 64ee003

Browse files
committed
PageLayout: Added Main Content Scrollbar
1 parent 1c9af82 commit 64ee003

File tree

5 files changed

+8
-3
lines changed

5 files changed

+8
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export function PageLayout(props: LayoutProps & { siderCollapsed: boolean; setSi
142142
}
143143

144144
useEffect(() => {setSiderCollapsed(container.siderCollapsed)} , [container.siderCollapsed]);
145-
145+
146146
return (
147147
<div style={{padding: style.margin, height: '100%'}}>
148148
<ConfigProvider
@@ -157,7 +157,7 @@ export function PageLayout(props: LayoutProps & { siderCollapsed: boolean; setSi
157157
}}
158158
>
159159
<Wrapper $style={style} $animationStyle={animationStyle}>
160-
<Layout style={{padding: "0px"}} hasSider={showSider && !container.innerSider}>
160+
<Layout style={{padding: "0px", overflow: container.mainScrollbars ? "scroll" : "inherit"}} hasSider={showSider && !container.innerSider}>
161161
{showSider && !container.innerSider && !container.siderRight && (
162162
<><BackgroundColorContext.Provider value={siderStyle?.siderBackground}>
163163
<Sider

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const childrenMap = {
5353
autoHeight: AutoHeightControl,
5454
siderScrollbars: withDefault(BoolControl, false),
5555
contentScrollbars: withDefault(BoolControl, false),
56+
mainScrollbars: withDefault(BoolControl, false),
5657
style: styleControl(ContainerStyle , 'style'),
5758
headerStyle: styleControl(ContainerHeaderStyle , 'headerStyle'),
5859
siderStyle: styleControl(ContainerSiderStyle , 'siderStyle'),
@@ -157,7 +158,8 @@ export class PageLayoutComp extends layoutBaseComp implements IContainer {
157158
heightPropertyView() {
158159
return [
159160
this.children.autoHeight.getPropertyView(),
160-
this.children.siderScrollbars.propertyView({ label: trans("prop.siderScrollbar")}),
161+
this.children.siderScrollbars.propertyView({ label: trans("prop.siderScrollbar") }),
162+
(!this.children.autoHeight.getView()) && this.children.mainScrollbars.propertyView({ label: trans("prop.mainScrollbar") }),
161163
(!this.children.autoHeight.getView()) && this.children.contentScrollbars.propertyView({ label: trans("prop.showVerticalScrollbar") }),
162164
];
163165
}

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ export const en = {
203203
"showVerticalScrollbar" : "Show Vertical Scrollbar",
204204
"showHorizontalScrollbar" : "Show Horizontal Scrollbar",
205205
"siderScrollbar" : "Show Scrollbars in Sider",
206+
"mainScrollbar": "Show Scrollbars in main content",
206207
"siderRight" : "Show sider on the Right",
207208
"siderWidth" : "Sider Width",
208209
"siderWidthTooltip" : "Sider width supports percentages (%) and pixels (px).",

translations/locales/en.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ export const en = {
196196
"textOverflow": "Text Overflow",
197197
"scrollbar": "Show Scrollbars",
198198
"siderScrollbar": "Show Scrollbars in Sider",
199+
"mainScrollbar": "Show Scrollbars in main content",
199200
"siderRight": "Show sider on the Right",
200201
"siderWidth": "Sider Width",
201202
"siderWidthTooltip": "Sider width supports percentages (%) and pixels (px).",

translations/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ export const en = {
201201
"textOverflow": "Text Overflow",
202202
"scrollbar": "Show Scrollbars",
203203
"siderScrollbar" : "Show Scrollbars in Sider",
204+
"mainScrollbar": "Show Scrollbars in main content",
204205
"siderRight" : "Show sider on the Right",
205206
"siderWidth" : "Sider Width",
206207
"siderWidthTooltip" : "Sider width supports percentages (%) and pixels (px).",

0 commit comments

Comments
 (0)