文本编辑tool与删除按钮tool的冲突解决方法 #2051
Unanswered
15643701048a
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
编辑文本
graph.on('cell:dblclick', ({ cell, e }) => {
const isNode = cell.isNode()
const name = cell.isNode() ? 'node-editor' : 'edge-editor'
cell.removeTool(name)
cell.addTools({
name,
args: {
event: e,
},
})
当鼠标正在编辑时,鼠标离开节点,会触发graph.on('node:mouseleave', ({ node }) => {
node.removeTool('button-remove'); 事件,去除删除按钮tool,不删除文本编辑tool,但鼠标离开节点后,文本会变回编辑前的文本,但焦点还在,可以继续编辑,有没有什么办法鼠标离开后保留编辑文本
Beta Was this translation helpful? Give feedback.
All reactions