Merge pull request #951 from ZhangMingZhao1/fix-exit-edit-pr

fix: 修复设置readonly如果处于编辑态还能编辑的问题
This commit is contained in:
街角小林 2024-10-23 09:18:18 +08:00 committed by GitHub
commit b5b8c2be60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -483,6 +483,10 @@ class MindMap {
if (this.opt.readonly) {
// 取消当前激活的元素
this.execCommand('CLEAR_ACTIVE_NODE')
// 如果处于编辑态,要隐藏所有的编辑框
if (this.renderer.textEdit.isShowTextEdit()) {
this.renderer.textEdit.hideEditTextBox()
}
}
this.emit('mode_change', mode)
}