Skip to content

Commit ec9c177

Browse files
authoredMar 15, 2024
Merge pull request #756 from lowcoder-org/module-layers-issue
Bug Fixes
2 parents cdbbb6c + 8d6c4bd commit ec9c177

File tree

4 files changed

+37
-15
lines changed

4 files changed

+37
-15
lines changed
 

‎client/packages/lowcoder/src/comps/controls/iconControl.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ function IconCodeEditor(props: {
165165
visible={visible}
166166
setVisible={setVisible}
167167
trigger="contextMenu"
168-
parent={document.querySelector<HTMLElement>(`${CodeEditorTooltipContainer}`)}
168+
// parent={document.querySelector<HTMLElement>(`${CodeEditorTooltipContainer}`)}
169169
searchKeywords={i18nObjs.iconSearchKeywords}
170170
/>
171171
),

‎client/packages/lowcoder/src/comps/hooks/modalComp.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ let TmpModalComp = (function () {
161161
items={gridItemCompToGridItems(items)}
162162
autoHeight={props.autoHeight}
163163
minHeight={paddingValues ? DEFAULT_HEIGHT - paddingValues[0] * 2 + "px" : ""}
164-
containerPadding={paddingValues ? [paddingValues[0], paddingValues[1]] : [24,24]}
164+
containerPadding={paddingValues ? [paddingValues[0] ?? 0, paddingValues[1] ?? 0] : [24,24]}
165165
hintPlaceholder={HintPlaceHolder}
166166
/>
167167
</Modal>

‎client/packages/lowcoder/src/layout/gridLayout.tsx

+9-2
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,15 @@ class GridLayout extends React.Component<GridLayoutProps, GridLayoutState> {
400400
// const ops = layoutOpUtils.push(this.state.ops, stickyItemOp(i, { h }));
401401
// this.setState({ ops });
402402
if (this.state.changedHs?.[i] !== h) {
403-
const changedHeights = { ...this.state.changedHs, [i]: h };
404-
this.setState({ changedHs: changedHeights });
403+
this.setState((prevState) => {
404+
return {
405+
...prevState,
406+
changedHs: {
407+
...prevState.changedHs,
408+
[i]: h,
409+
}
410+
}
411+
})
405412
}
406413
};
407414

‎client/packages/lowcoder/src/pages/editor/LeftLayersContent.tsx

+26-11
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
import { DownOutlined } from "@ant-design/icons";
3434
import { ItemType } from "antd/es/menu/hooks/useItems";
3535
import ColorPicker, { configChangeParams } from "components/ColorPicker";
36+
import { ModuleLayoutComp } from "@lowcoder-ee/comps/comps/moduleContainerComp/moduleLayoutComp";
3637

3738

3839
export type DisabledCollisionStatus = "true" | "false"; // "true" means collision is not enabled - Layering works, "false" means collision is enabled - Layering does not work
@@ -209,17 +210,31 @@ export const LeftLayersContent = (props: LeftLayersContentProps) => {
209210

210211
const dsl = editorState.rootComp.toJsonValue();
211212
let layout: any = {};
212-
parentNode.children.forEach((data, index) => {
213-
layout[data.key] = {
214-
...dsl.ui.layout[data.key],
215-
pos: index,
216-
};
217-
})
218-
219-
editorState.rootComp.children.ui.dispatchChangeValueAction({
220-
...dsl.ui,
221-
layout,
222-
})
213+
if(dsl.ui.compType === 'module') {
214+
parentNode.children.forEach((data, index) => {
215+
layout[data.key] = {
216+
...dsl.ui.comp.container.layout[data.key],
217+
pos: index,
218+
};
219+
})
220+
const moduleLayoutComp = editorState.rootComp.children.ui.getModuleLayoutComp();
221+
moduleLayoutComp?.children.container.dispatchChangeValueAction({
222+
...dsl.ui.comp.container,
223+
layout,
224+
})
225+
} else {
226+
parentNode.children.forEach((data, index) => {
227+
layout[data.key] = {
228+
...dsl.ui.layout[data.key],
229+
pos: index,
230+
};
231+
})
232+
233+
editorState.rootComp.children.ui.dispatchChangeValueAction({
234+
...dsl.ui,
235+
layout,
236+
})
237+
}
223238
return newTreeData;
224239
});
225240
}

0 commit comments

Comments
 (0)