Skip to content

Commit 7833a53

Browse files
authored
fix(demo-free-layout): loop expanded (#706)
1 parent 397ccad commit 7833a53

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

apps/demo-free-layout/src/nodes/loop/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export const LoopNodeRegistry: FlowNodeRegistry = {
3737
width: 424,
3838
height: 244,
3939
},
40+
autoResizeDisable: true,
4041
/**
4142
* The subcanvas padding setting
4243
* 子画布 padding 设置

apps/demo-free-layout/src/utils/toggle-loop-expanded.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export function toggleLoopExpanded(
1717
};
1818
node.transform.collapsed = !expanded;
1919
if (!expanded) {
20+
node.transform.transform.clearChildren();
2021
node.transform.transform.update({
2122
position: {
2223
x: prePosition.x - node.transform.padding.left,
@@ -27,14 +28,12 @@ export function toggleLoopExpanded(
2728
y: 0,
2829
},
2930
});
30-
setTimeout(() => {
31-
// When folded, the width and height no longer change according to the child nodes, and need to be set manually
32-
// 折叠起来,宽高不再根据子节点变化,需要手动设置
33-
node.transform.size = {
34-
width: bounds.width,
35-
height: heightCollapsed,
36-
};
37-
}, 0);
31+
// When folded, the width and height no longer change according to the child nodes, and need to be set manually
32+
// 折叠起来,宽高不再根据子节点变化,需要手动设置
33+
node.transform.size = {
34+
width: bounds.width,
35+
height: heightCollapsed,
36+
};
3837
} else {
3938
node.transform.transform.update({
4039
position: {

0 commit comments

Comments
 (0)