Fix:修复开启openRealtimeRenderOnNodeTextEdit选项后非富文本模式编辑文本时输入框会左右抖动的问题
This commit is contained in:
parent
a0f88031c1
commit
34d7c6fed2
@ -157,7 +157,8 @@ class Render {
|
|||||||
node.height = height
|
node.height = height
|
||||||
node.layout()
|
node.layout()
|
||||||
this.mindMap.render(() => {
|
this.mindMap.render(() => {
|
||||||
this.textEdit.updateTextEditNode()
|
// 输入框的left不会改变,所以无需更新
|
||||||
|
this.textEdit.updateTextEditNode(['left'])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -308,7 +308,8 @@ export default class TextEdit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 更新文本编辑框的大小和位置
|
// 更新文本编辑框的大小和位置
|
||||||
updateTextEditNode() {
|
// notChangeProps:不会发生改变的属性列表
|
||||||
|
updateTextEditNode(notChangeProps = []) {
|
||||||
if (this.mindMap.richText) {
|
if (this.mindMap.richText) {
|
||||||
this.mindMap.richText.updateTextEditNode()
|
this.mindMap.richText.updateTextEditNode()
|
||||||
return
|
return
|
||||||
@ -321,7 +322,8 @@ export default class TextEdit {
|
|||||||
rect.width + this.textNodePaddingX * 2 + 'px'
|
rect.width + this.textNodePaddingX * 2 + 'px'
|
||||||
this.textEditNode.style.minHeight =
|
this.textEditNode.style.minHeight =
|
||||||
rect.height + this.textNodePaddingY * 2 + 'px'
|
rect.height + this.textNodePaddingY * 2 + 'px'
|
||||||
this.textEditNode.style.left = rect.left + 'px'
|
if (!notChangeProps.includes('left'))
|
||||||
|
this.textEditNode.style.left = rect.left + 'px'
|
||||||
this.textEditNode.style.top = rect.top + 'px'
|
this.textEditNode.style.top = rect.top + 'px'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user