Skip to content

Commit 8f9f9dc

Browse files
Fix module comps shaking issue
1 parent 868858f commit 8f9f9dc

File tree

5 files changed

+36
-46
lines changed

5 files changed

+36
-46
lines changed

client/packages/lowcoder-design/src/components/ScrollBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ interface IProps {
5959
}
6060

6161
export const ScrollBar = ({
62-
height = "100%",
6362
className,
6463
children,
6564
style,
@@ -68,6 +67,7 @@ export const ScrollBar = ({
6867
$hideplaceholder = false,
6968
...otherProps
7069
}: IProps) => {
70+
const height = style?.height ?? '100%';
7171
// You can now use the style prop directly or pass it to SimpleBar
7272
const combinedStyle = { ...style, height }; // Example of combining height with passed style
7373

client/packages/lowcoder/src/comps/comps/gridLayoutComp/canvasView.tsx

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -114,21 +114,17 @@ export function CanvasView(props: ContainerBaseProps) {
114114
className={CNRootContainer}
115115
$bgColor={bgColor}
116116
>
117-
<div>
118-
<ScrollBar style={{ height: "100%", margin: "0px", padding: "0px" }}>
119-
<Profiler id="Panel" onRender={profilerCallback}>
120-
<InnerGrid
121-
containerPadding={rootContainerPadding}
122-
overflow={rootContainerOverflow}
123-
{...props}
124-
positionParams={positionParams} // Added By Aqib Mirza
125-
{...gridLayoutCanvasProps}
126-
bgColor={bgColor}
127-
radius="0px"
128-
/>
129-
</Profiler>
130-
</ScrollBar>
131-
</div>
117+
<Profiler id="Panel" onRender={profilerCallback}>
118+
<InnerGrid
119+
containerPadding={rootContainerPadding}
120+
overflow={rootContainerOverflow}
121+
{...props}
122+
positionParams={positionParams} // Added By Aqib Mirza
123+
{...gridLayoutCanvasProps}
124+
bgColor={bgColor}
125+
radius="0px"
126+
/>
127+
</Profiler>
132128
</UICompContainer>
133129
);
134130
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class ModuleTmpComp extends ModuleCompBase {
123123
)}
124124
<Section name={sectionNames.layout}>
125125
{!this.autoScaleCompHeight() && this.children.autoHeight.getPropertyView()}
126-
{this.children.scrollbars.propertyView({
126+
{!this.autoScaleCompHeight() && this.children.scrollbars.propertyView({
127127
label: trans("prop.scrollbar"),
128128
})}
129129
{hiddenPropertyView(this.children)}
@@ -531,7 +531,7 @@ const ModuleCompWithView = withViewFn(ModuleTmpComp, (comp) => {
531531
if (comp.moduleRootComp && comp.isReady) {
532532
content = (
533533
<Wrapper className="module-wrapper">
534-
<ScrollBar style={{ height: comp.autoHeight() ? "100%" : "auto", margin: "0px", padding: "0px" }} hideScrollbar={!scrollbars}>
534+
<ScrollBar style={{ height: comp.autoHeight() ? "100%" : "100%", margin: "0px", padding: "0px" }} hideScrollbar={!scrollbars}>
535535
<ExternalEditorContext.Provider value={moduleExternalState}>
536536
{comp.moduleRootComp.getView()}
537537
</ExternalEditorContext.Provider>

client/packages/lowcoder/src/comps/comps/moduleContainerComp/moduleLayoutComp.tsx

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ function ModuleLayoutView(props: IProps) {
6767

6868
if (readOnly) {
6969
return (
70-
<ScrollBar style={{ height: "100%", margin: "0px", padding: "0px" }}>
71-
<ModulePreviewWrapper className={CNRootContainer}>{props.containerView}</ModulePreviewWrapper>
72-
</ScrollBar>
70+
<ModulePreviewWrapper className={CNRootContainer}>{props.containerView}</ModulePreviewWrapper>
7371
);
7472
}
7573

@@ -115,30 +113,26 @@ export class ModuleLayoutComp extends ModuleLayoutCompBase implements IContainer
115113
const isRowCountLocked = this.children.autoScaleCompHeight.getView();
116114
const rowCount = this.children.containerRowCount.getView();
117115
return (
118-
<div>
119-
<ScrollBar style={{ height: "100%", margin: "0px", padding: "0px" }} $hideplaceholder={false}>
120-
<ModuleLayoutView
121-
positionParams={this.children.positionParams.getView()}
122-
containerSize={this.children.containerSize.getView()}
123-
containerView={this.children.container.containerView({
124-
rowCount,
125-
isRowCountLocked,
126-
onRowCountChange: (rowCount) => {
127-
this.children.containerRowCount.dispatchChangeValueAction(rowCount);
128-
},
129-
})}
130-
onPositionParamsChange={(params) => {
131-
setTimeout(() => this.children.positionParams.dispatchChangeValueAction(params));
132-
}}
133-
onLayoutChange={(layout) => {
134-
this.children.containerSize.dispatchChangeValueAction({
135-
height: layout[moduleContainerId].h,
136-
width: layout[moduleContainerId].w,
137-
});
138-
}}
139-
/>
140-
</ScrollBar>
141-
</div>
116+
<ModuleLayoutView
117+
positionParams={this.children.positionParams.getView()}
118+
containerSize={this.children.containerSize.getView()}
119+
containerView={this.children.container.containerView({
120+
rowCount,
121+
isRowCountLocked,
122+
onRowCountChange: (rowCount) => {
123+
this.children.containerRowCount.dispatchChangeValueAction(rowCount);
124+
},
125+
})}
126+
onPositionParamsChange={(params) => {
127+
setTimeout(() => this.children.positionParams.dispatchChangeValueAction(params));
128+
}}
129+
onLayoutChange={(layout) => {
130+
this.children.containerSize.dispatchChangeValueAction({
131+
height: layout[moduleContainerId].h,
132+
width: layout[moduleContainerId].w,
133+
});
134+
}}
135+
/>
142136
);
143137
}
144138
getPropertyView() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function RootView(props: RootViewProps) {
122122
}
123123

124124
return (
125-
<div {...divProps}>
125+
<div {...divProps} style={{height: '100%'}}>
126126
<PropertySectionContext.Provider value={propertySectionContextValue}>
127127
<ThemeContext.Provider value={themeContextValue}>
128128
<EditorContext.Provider value={editorState}>

0 commit comments

Comments
 (0)