Skip to content

Commit bfdbe22

Browse files
committed
fix(nodeOperation): prevent incorrect sibling insertion in root node
fixed #329
1 parent 3a40a90 commit bfdbe22

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mind-elixir",
3-
"version": "4.6.1",
3+
"version": "4.6.2",
44
"type": "module",
55
"description": "Mind elixir is a free open source mind map core.",
66
"keywords": [

src/nodeOperation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const insertSibling = function (this: MindElixirInstance, type: 'before'
6060
if (!nodeObj.parent) {
6161
this.addChild()
6262
return
63-
} else if (!nodeObj.parent?.parent && nodeObj.parent?.children?.length === 1) {
63+
} else if (!nodeObj.parent?.parent && nodeObj.parent?.children?.length === 1 && this.direction === 2) {
6464
// add at least one node to another side
6565
this.addChild(findEle(nodeObj.parent!.id), node)
6666
return

0 commit comments

Comments
 (0)