Skip to content

Commit 5705b80

Browse files
committed
fix: fire addChild before beginEdit
1 parent fcb3d2b commit 5705b80

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/nodeOperation.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,15 +284,15 @@ export const addChild = function(el: NodeElement, node: NodeObj) {
284284
const nodeEle = el || this.currentNode
285285
if (!nodeEle) return
286286
const { newTop, newNodeObj } = addChildFunction.call(this, nodeEle, node)
287+
this.bus.fire('operation', {
288+
name: 'addChild',
289+
obj: newNodeObj,
290+
})
287291
console.timeEnd('addChild')
288292
if (!node) {
289293
this.createInputDiv(newTop.children[0])
290294
}
291295
this.selectNode(newTop.children[0], true)
292-
this.bus.fire('operation', {
293-
name: 'addChild',
294-
obj: newNodeObj,
295-
})
296296
}
297297
// uncertain link disappear sometimes??
298298
// TODO while direction = SIDE, move up won't change the direction of primary node

0 commit comments

Comments
 (0)