Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bug Fixes #756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix crashing on reordering comps inside module
  • Loading branch information
raheeliftikhar5 committed Mar 14, 2024
commit d9d0883c09523c19f5e7e21ab46ed00fee7fcc4b
37 changes: 26 additions & 11 deletions client/packages/lowcoder/src/pages/editor/LeftLayersContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
import { DownOutlined } from "@ant-design/icons";
import { ItemType } from "antd/es/menu/hooks/useItems";
import ColorPicker, { configChangeParams } from "components/ColorPicker";
import { ModuleLayoutComp } from "@lowcoder-ee/comps/comps/moduleContainerComp/moduleLayoutComp";


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

const dsl = editorState.rootComp.toJsonValue();
let layout: any = {};
parentNode.children.forEach((data, index) => {
layout[data.key] = {
...dsl.ui.layout[data.key],
pos: index,
};
})

editorState.rootComp.children.ui.dispatchChangeValueAction({
...dsl.ui,
layout,
})
if(dsl.ui.compType === 'module') {
parentNode.children.forEach((data, index) => {
layout[data.key] = {
...dsl.ui.comp.container.layout[data.key],
pos: index,
};
})
const moduleLayoutComp = editorState.rootComp.children.ui.getModuleLayoutComp();
moduleLayoutComp?.children.container.dispatchChangeValueAction({
...dsl.ui.comp.container,
layout,
})
} else {
parentNode.children.forEach((data, index) => {
layout[data.key] = {
...dsl.ui.layout[data.key],
pos: index,
};
})

editorState.rootComp.children.ui.dispatchChangeValueAction({
...dsl.ui,
layout,
})
}
return newTreeData;
});
}
Expand Down