diff --git a/simple-mind-map/src/core/render/TextEdit.js b/simple-mind-map/src/core/render/TextEdit.js index d12616df..ad6cc6e6 100644 --- a/simple-mind-map/src/core/render/TextEdit.js +++ b/simple-mind-map/src/core/render/TextEdit.js @@ -334,15 +334,16 @@ export default class TextEdit { if (!this.showTextEdit) { return } - this.renderer.activeNodeList.forEach(node => { - let str = this.getEditText() - this.mindMap.execCommand('SET_NODE_TEXT', node, str) - if (node.isGeneralization) { - // 概要节点 - node.generalizationBelongNode.updateGeneralization() - } - this.mindMap.render() - }) + this.mindMap.execCommand( + 'SET_NODE_TEXT', + this.currentNode, + this.getEditText() + ) + if (this.currentNode.isGeneralization) { + // 概要节点 + this.currentNode.generalizationBelongNode.updateGeneralization() + } + this.mindMap.render() const currentNode = this.currentNode this.currentNode = null this.textEditNode.style.display = 'none' diff --git a/simple-mind-map/src/plugins/RichText.js b/simple-mind-map/src/plugins/RichText.js index f75e5993..2752d7fc 100644 --- a/simple-mind-map/src/plugins/RichText.js +++ b/simple-mind-map/src/plugins/RichText.js @@ -388,8 +388,7 @@ class RichText { } let html = this.getEditText() html = this.sortHtmlNodeStyles(html) - let list = - nodes && nodes.length > 0 ? nodes : this.mindMap.renderer.activeNodeList + const list = nodes && nodes.length > 0 ? nodes : [this.node] list.forEach(node => { this.mindMap.execCommand('SET_NODE_TEXT', node, html, true) // if (node.isGeneralization) {