Skip to content

Commit b59560a

Browse files
committed
ResponsiveLayout: Added Main Content Scrollbar
1 parent 64ee003 commit b59560a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { sameTypeMap, UICompBuilder, withDefault } from "comps/generators";
1818
import { addMapChildAction } from "comps/generators/sameTypeMap";
1919
import { NameConfigHidden, withExposingConfigs } from "comps/generators/withExposing";
2020
import { NameGenerator } from "comps/utils";
21-
import { Section, controlItem, sectionNames } from "lowcoder-design";
21+
import { ScrollBar, Section, controlItem, sectionNames } from "lowcoder-design";
2222
import { HintPlaceHolder } from "lowcoder-design";
2323
import _ from "lodash";
2424
import React, { useEffect } from "react";
@@ -95,6 +95,7 @@ const childrenMap = {
9595
matchColumnsHeight: withDefault(BoolControl, true),
9696
style: styleControl(ResponsiveLayoutRowStyle , 'style'),
9797
columnStyle: styleControl(ResponsiveLayoutColStyle , 'columnStyle'),
98+
mainScrollbar: withDefault(BoolControl, false),
9899
animationStyle:styleControl(AnimationStyle , 'animationStyle'),
99100
columnPerRowLG: withDefault(NumberControl, 4),
100101
columnPerRowMD: withDefault(NumberControl, 2),
@@ -138,12 +139,15 @@ const ResponsiveLayout = (props: ResponsiveLayoutProps) => {
138139
horizontalSpacing,
139140
animationStyle,
140141
horizontalGridCells,
142+
mainScrollbar,
143+
autoHeight
141144
} = props;
142145

143146
return (
144147
<BackgroundColorContext.Provider value={props.style.background}>
145148
<DisabledContext.Provider value={props.disabled}>
146149
<div style={{padding: style.margin, height: '100%'}}>
150+
<ScrollBar style={{ height: autoHeight ? "auto" : "100%", margin: "0px", padding: "0px" }} hideScrollbar={!mainScrollbar}>
147151
<RowWrapper
148152
$style={style}
149153
$animationStyle={animationStyle}
@@ -181,6 +185,7 @@ const ResponsiveLayout = (props: ResponsiveLayoutProps) => {
181185
})
182186
}
183187
</RowWrapper>
188+
</ScrollBar>
184189
</div>
185190
</DisabledContext.Provider>
186191
</BackgroundColorContext.Provider>
@@ -214,6 +219,9 @@ export const ResponsiveLayoutBaseComp = (function () {
214219
<>
215220
<Section name={sectionNames.layout}>
216221
{children.autoHeight.getPropertyView()}
222+
{(!children.autoHeight.getView()) && children.mainScrollbar.propertyView({
223+
label: trans("prop.mainScrollbar")
224+
})}
217225
{children.horizontalGridCells.propertyView({
218226
label: trans('prop.horizontalGridCells'),
219227
})}

0 commit comments

Comments
 (0)