From cd29a9a3136ff987572d9bdc8cf0b491ddb8e495 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 3 Nov 2023 11:23:44 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=95=B0=E6=8D=AE=E5=BA=93=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E6=9B=B4=E6=96=B0=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/render/av/action.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts index e0e051d5d..6dfb7afd3 100644 --- a/app/src/protyle/render/av/action.ts +++ b/app/src/protyle/render/av/action.ts @@ -370,6 +370,20 @@ export const updateAVName = (protyle: IProtyle, blockElement: Element) => { blockElement.setAttribute("updated", newUpdated); nameElement.dataset.title = newData; blockElement.querySelector(".layout-tab-bar .item__text").textContent = newData; + + // 当前页面不能进行推送,否则光标会乱跳 + Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${avId}"]`)).forEach((item: HTMLElement) => { + if(blockElement.isSameNode(item)) { + return; + } + const titleElement = item.querySelector(".av__title") as HTMLElement; + if (!titleElement) { + return; + } + titleElement.textContent = newData; + titleElement.dataset.title = newData; + item.querySelector(".layout-tab-bar .item__text").textContent = newData; + }); }; export const updateAttrViewCellAnimation = (cellElement: HTMLElement) => {