Fix:修复非富文本模式编辑时粘贴文本不会触发node_text_edit_change事件的问题
This commit is contained in:
parent
4332abce4d
commit
a7d97065c6
@ -341,13 +341,10 @@ export default class TextEdit {
|
|||||||
} else {
|
} else {
|
||||||
handleInputPasteText(e)
|
handleInputPasteText(e)
|
||||||
}
|
}
|
||||||
|
this.emitTextChangeEvent()
|
||||||
})
|
})
|
||||||
this.textEditNode.addEventListener('input', () => {
|
this.textEditNode.addEventListener('input', () => {
|
||||||
this.mindMap.emit('node_text_edit_change', {
|
this.emitTextChangeEvent()
|
||||||
node: this.currentNode,
|
|
||||||
text: this.getEditText(),
|
|
||||||
richText: false
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
const targetNode =
|
const targetNode =
|
||||||
this.mindMap.opt.customInnerElsAppendTo || document.body
|
this.mindMap.opt.customInnerElsAppendTo || document.body
|
||||||
@ -399,6 +396,15 @@ export default class TextEdit {
|
|||||||
this.cacheEditingText = ''
|
this.cacheEditingText = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 派发节点文本编辑事件
|
||||||
|
emitTextChangeEvent() {
|
||||||
|
this.mindMap.emit('node_text_edit_change', {
|
||||||
|
node: this.currentNode,
|
||||||
|
text: this.getEditText(),
|
||||||
|
richText: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 更新文本编辑框的大小和位置
|
// 更新文本编辑框的大小和位置
|
||||||
updateTextEditNode() {
|
updateTextEditNode() {
|
||||||
if (this.mindMap.richText) {
|
if (this.mindMap.richText) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user