Feat:阻止mousedown、mousemove、drag、node_mousedown事件的默认行为

This commit is contained in:
街角小林 2024-06-24 18:52:36 +08:00
parent a047dabbd0
commit dc096fd535
2 changed files with 3 additions and 0 deletions

View File

@ -99,6 +99,7 @@ class Event extends EventEmitter {
// 鼠标按下事件 // 鼠标按下事件
onMousedown(e) { onMousedown(e) {
e.preventDefault()
// 鼠标左键 // 鼠标左键
if (e.which === 1) { if (e.which === 1) {
this.isLeftMousedown = true this.isLeftMousedown = true
@ -114,6 +115,7 @@ class Event extends EventEmitter {
// 鼠标移动事件 // 鼠标移动事件
onMousemove(e) { onMousemove(e) {
e.preventDefault()
let { useLeftKeySelectionRightKeyDrag } = this.mindMap.opt let { useLeftKeySelectionRightKeyDrag } = this.mindMap.opt
this.mousemovePos.x = e.clientX this.mousemovePos.x = e.clientX
this.mousemovePos.y = e.clientY this.mousemovePos.y = e.clientY

View File

@ -515,6 +515,7 @@ class Node {
this.active(e) this.active(e)
}) })
this.group.on('mousedown', e => { this.group.on('mousedown', e => {
e.preventDefault()
const { const {
readonly, readonly,
enableCtrlKeyNodeSelection, enableCtrlKeyNodeSelection,