Fix:修复mac上useLeftKeySelectionRightKeyDrag为true 时无法按住ctrl键多选节点的问题

This commit is contained in:
wanglin2 2024-01-10 21:49:30 +08:00
parent 69264e3a9d
commit d7bd57ffac
2 changed files with 3 additions and 1 deletions

View File

@ -165,6 +165,8 @@ class Event extends EventEmitter {
// 鼠标右键菜单事件
onContextmenu(e) {
e.preventDefault()
// Mac上按住ctrl键点击鼠标左键不知为何触发的是contextmenu事件
if (e.ctrlKey) return
this.emit('contextmenu', e)
}

View File

@ -495,7 +495,7 @@ class Node {
// 右键菜单事件
this.group.on('contextmenu', e => {
const { readonly, useLeftKeySelectionRightKeyDrag } = this.mindMap.opt
// 按住ctrl键点击鼠标左键不知为何触发的是contextmenu事件
// Mac上按住ctrl键点击鼠标左键不知为何触发的是contextmenu事件
if (readonly || e.ctrlKey) {
return
}