mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 14:04:47 +08:00
Fix:修复开启openRealtimeRenderOnNodeTextEdit选项后非富文本模式编辑文本时输入框会左右抖动的问题
This commit is contained in:
@@ -157,7 +157,8 @@ class Render {
|
||||
node.height = height
|
||||
node.layout()
|
||||
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) {
|
||||
this.mindMap.richText.updateTextEditNode()
|
||||
return
|
||||
@@ -321,7 +322,8 @@ export default class TextEdit {
|
||||
rect.width + this.textNodePaddingX * 2 + 'px'
|
||||
this.textEditNode.style.minHeight =
|
||||
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'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user