Fix:修复节点处于编辑状态时,通过鼠标滚动移动画布后编辑框和节点脱离的问题
This commit is contained in:
parent
790662ad0c
commit
34eece8fcf
@ -5,7 +5,7 @@ import {
|
|||||||
selectAllInput,
|
selectAllInput,
|
||||||
htmlEscape
|
htmlEscape
|
||||||
} from '../../utils'
|
} from '../../utils'
|
||||||
import { ERROR_TYPES } from '../../constants/constant'
|
import { ERROR_TYPES, CONSTANTS } from '../../constants/constant'
|
||||||
|
|
||||||
// 节点文字编辑类
|
// 节点文字编辑类
|
||||||
export default class TextEdit {
|
export default class TextEdit {
|
||||||
@ -54,6 +54,12 @@ export default class TextEdit {
|
|||||||
this.mindMap.on('before_node_active', () => {
|
this.mindMap.on('before_node_active', () => {
|
||||||
this.hideEditTextBox()
|
this.hideEditTextBox()
|
||||||
})
|
})
|
||||||
|
// 鼠标滚动事件
|
||||||
|
this.mindMap.on('mousewheel', () => {
|
||||||
|
if (this.mindMap.opt.mousewheelAction === CONSTANTS.MOUSE_WHEEL_ACTION.MOVE) {
|
||||||
|
this.hideEditTextBox()
|
||||||
|
}
|
||||||
|
})
|
||||||
// 注册编辑快捷键
|
// 注册编辑快捷键
|
||||||
this.mindMap.keyCommand.addShortcut('F2', () => {
|
this.mindMap.keyCommand.addShortcut('F2', () => {
|
||||||
if (this.renderer.activeNodeList.length <= 0) {
|
if (this.renderer.activeNodeList.length <= 0) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user