Fix:修复删除正在编辑中的节点时实际上删除的是相邻节点的问题
This commit is contained in:
parent
8b90557f70
commit
460d4ea558
@ -1213,7 +1213,15 @@ class Render {
|
|||||||
// 如果只选中了一个节点,删除后激活其兄弟节点或者父节点
|
// 如果只选中了一个节点,删除后激活其兄弟节点或者父节点
|
||||||
needActiveNode = this.getNextActiveNode()
|
needActiveNode = this.getNextActiveNode()
|
||||||
for (let i = 0; i < list.length; i++) {
|
for (let i = 0; i < list.length; i++) {
|
||||||
let node = list[i]
|
const node = list[i]
|
||||||
|
const currentEditNode = this.textEdit.getCurrentEditNode()
|
||||||
|
if (
|
||||||
|
currentEditNode &&
|
||||||
|
currentEditNode.getData('uid') === node.getData('uid')
|
||||||
|
) {
|
||||||
|
// 如果当前节点正在编辑中,那么先完成编辑
|
||||||
|
this.textEdit.hideEditTextBox()
|
||||||
|
}
|
||||||
if (isAppointNodes) list.splice(i, 1)
|
if (isAppointNodes) list.splice(i, 1)
|
||||||
if (node.isGeneralization) {
|
if (node.isGeneralization) {
|
||||||
this.deleteNodeGeneralization(node)
|
this.deleteNodeGeneralization(node)
|
||||||
|
|||||||
@ -315,4 +315,12 @@ export default class TextEdit {
|
|||||||
this.textEditNode.style.transform = 'translateY(0)'
|
this.textEditNode.style.transform = 'translateY(0)'
|
||||||
this.showTextEdit = false
|
this.showTextEdit = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取当前正在编辑中的节点实例
|
||||||
|
getCurrentEditNode() {
|
||||||
|
if (this.mindMap.richText) {
|
||||||
|
return this.mindMap.richText.node
|
||||||
|
}
|
||||||
|
return this.currentNode
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user