From 887c799fc9fb195c8af271ed6a6ee6726bb4c65a Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 2 Jan 2023 13:29:03 -0800 Subject: [PATCH] Fix bug on collapse node. --- packages/mindplot/src/components/Designer.ts | 5 +++++ packages/mindplot/src/components/Topic.ts | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/mindplot/src/components/Designer.ts b/packages/mindplot/src/components/Designer.ts index 75a56fc6..6c8cbe77 100644 --- a/packages/mindplot/src/components/Designer.ts +++ b/packages/mindplot/src/components/Designer.ts @@ -445,6 +445,11 @@ class Designer extends Events { const mindmap = parentModel.getMindmap(); const childModel = mindmap.createNode(); + // If node is shink, expand ... + if (topic.areChildrenShrunken()) { + topic.setChildrenShrunken(false); + } + // Create a new node ... const layoutManager = this._eventBussDispatcher.getLayoutManager(); const result = layoutManager.predict(topic.getId(), null, mousePos); diff --git a/packages/mindplot/src/components/Topic.ts b/packages/mindplot/src/components/Topic.ts index 11499741..415f8f05 100644 --- a/packages/mindplot/src/components/Topic.ts +++ b/packages/mindplot/src/components/Topic.ts @@ -633,7 +633,6 @@ abstract class Topic extends NodeGraph { }); } - /** */ areChildrenShrunken(): boolean { const model = this.getModel(); return model.areChildrenShrunken() && !this.isCentralTopic();