From 4598025f2b936339da33531210cc1ce1e311cff6 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 20 Apr 2024 10:04:21 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/11019 --- app/src/protyle/render/av/render.ts | 2 +- app/src/protyle/wysiwyg/index.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts index 9287ed691..476662789 100644 --- a/app/src/protyle/render/av/render.ts +++ b/app/src/protyle/render/av/render.ts @@ -394,7 +394,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => { if (operation.action === "setAttrViewColWidth") { Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => { const cellElement = item.querySelector(`.av__cell[data-col-id="${operation.id}"]`) as HTMLElement; - if (!cellElement || cellElement.style.width === operation.data) { + if (!cellElement || cellElement.style.width === operation.data || item.getAttribute("custom-sy-av-view") !== operation.keyID) { return; } item.querySelectorAll(".av__row").forEach(rowItem => { diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 374b06f6d..6b19ec5ab 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -439,18 +439,21 @@ export class WYSIWYG { if (!newWidth || newWidth === oldWidth) { return; } + const viewId = nodeElement.getAttribute("custom-sy-av-view"); transaction(protyle, [{ action: "setAttrViewColWidth", id: dragColId, avID: avId, data: newWidth + "px", - blockID + blockID, + keyID: viewId // 仅前端使用,用于推送时不影响其他视图 https://github.com/siyuan-note/siyuan/issues/11019 }], [{ action: "setAttrViewColWidth", id: dragColId, avID: avId, data: oldWidth + "px", - blockID + blockID, + keyID: viewId }]); }; this.preventClick = true;