瀏覽代碼

:bug: fix https://github.com/siyuan-note/siyuan/issues/6594

Vanessa 2 年之前
父節點
當前提交
018971ae24
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      app/src/protyle/index.ts

+ 6 - 3
app/src/protyle/index.ts

@@ -122,9 +122,12 @@ export class Protyle {
                                     this.protyle.background.ial.title = data.data.title;
                                     this.protyle.background.ial.title = data.data.title;
                                 }
                                 }
                             }
                             }
-                            if (this.protyle.options.render.title && this.protyle.block.parentID === data.data.id &&
-                                this.protyle.title.editElement.textContent !== data.data.title) {
-                                this.protyle.title.setTitle(data.data.title);
+                            if (this.protyle.options.render.title && this.protyle.block.parentID === data.data.id) {
+                                if (getSelection().rangeCount > 0 && this.protyle.title.editElement.contains(getSelection().getRangeAt(0).startContainer)) {
+                                    // 标题编辑中的不用更新 https://github.com/siyuan-note/siyuan/issues/6565
+                                } else {
+                                    this.protyle.title.setTitle(data.data.title);
+                                }
                             }
                             }
                             // update ref
                             // update ref
                             this.protyle.wysiwyg.element.querySelectorAll(`[data-type~="block-ref"][data-id="${data.data.id}"]`).forEach(item => {
                             this.protyle.wysiwyg.element.querySelectorAll(`[data-type~="block-ref"][data-id="${data.data.id}"]`).forEach(item => {