From 187bf559121c0577da71caeccf9433d8ccafb205 Mon Sep 17 00:00:00 2001 From: Zhigang Zhang Date: Thu, 14 Mar 2024 12:10:58 +0800 Subject: [PATCH] update index after node is moved to other parent (#585) --- src/jsmind.mind.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/jsmind.mind.js b/src/jsmind.mind.js index 02f4a6e2..bb01e2dc 100644 --- a/src/jsmind.mind.js +++ b/src/jsmind.mind.js @@ -181,8 +181,10 @@ export class Mind { break; } } + let origin_parent = node.parent; node.parent = parent_node; parent_node.children.push(node); + this._update_index(origin_parent); } if (node.parent.isroot) {