From e769c9602b6bfeb57e40be7ab16a4d3d706cc031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=97=E8=A7=92=E5=B0=8F=E6=9E=97?= <1013335014@qq.com> Date: Thu, 7 Nov 2024 09:27:18 +0800 Subject: [PATCH] =?UTF-8?q?Feat=EF=BC=9A=E5=8F=AA=E6=9C=89=E5=BD=93?= =?UTF-8?q?=E6=8C=89=E9=94=AE=E4=BA=8B=E4=BB=B6=E7=9A=84=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E4=B8=BAbody=E6=97=B6=E6=89=8D=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E8=87=AA=E5=8A=A8=E8=BF=9B=E5=85=A5=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E7=BC=96=E8=BE=91=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/core/render/TextEdit.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/simple-mind-map/src/core/render/TextEdit.js b/simple-mind-map/src/core/render/TextEdit.js index ef9ae096..84f0a789 100644 --- a/simple-mind-map/src/core/render/TextEdit.js +++ b/simple-mind-map/src/core/render/TextEdit.js @@ -133,6 +133,7 @@ export default class TextEdit { // 按键事件 onKeydown(e) { + if (e.target !== document.body) return const activeNodeList = this.mindMap.renderer.activeNodeList if (activeNodeList.length <= 0 || activeNodeList.length > 1) return const node = activeNodeList[0] @@ -274,7 +275,9 @@ export default class TextEdit { this.registerTmpShortcut() if (!this.textEditNode) { this.textEditNode = document.createElement('div') - this.textEditNode.classList.add('smm-node-edit-wrap') + this.textEditNode.classList.add( + CONSTANTS.EDIT_NODE_CLASS.SMM_NODE_EDIT_WRAP + ) this.textEditNode.style.cssText = ` position: fixed; box-sizing: border-box;