From a30f229ade527268a157dafc61b8a86fc78b00b7 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 12 Aug 2025 01:23:47 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/15518 --- app/src/protyle/render/av/cell.ts | 8 ++++---- app/src/protyle/wysiwyg/index.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index 3c6d9c390..78b3dc0b3 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -108,7 +108,7 @@ export const genCellValueByElement = (colType: TAVCol, cellElement: HTMLElement) const contents: IAVCellValue[] = []; Array.from(cellElement.querySelectorAll(".av__cell--relation")).forEach((relationItem: HTMLElement) => { const item = relationItem.querySelector(".av__celltext") as HTMLElement; - blockIDs.push(item.dataset.rowId); + blockIDs.push(relationItem.dataset.rowId); contents.push({ isDetached: !item.classList.contains("av__celltext--ref"), block: { @@ -1102,7 +1102,7 @@ export const getPositionByCellElement = (cellElement: HTMLElement) => { export const dragFillCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, originData: { [key: string]: IAVCellValue[] -}, originCellIds: string[]) => { +}, originCellIds: string[], activeElement: Element) => { nodeElement.querySelector(".av__drag-fill")?.remove(); const newData: { [key: string]: Array } = {}; nodeElement.querySelectorAll(".av__cell--active").forEach((item: HTMLElement) => { @@ -1128,6 +1128,7 @@ export const dragFillCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, const undoOperations: IOperation[] = []; const avID = nodeElement.dataset.avId; const originKeys = Object.keys(originData); + const showIcon = activeElement.querySelector(".b3-menu__avemoji") ? true : false; Object.keys(newData).forEach((rowID, index) => { newData[rowID].forEach((item, cellIndex) => { if (["rollup", "template", "created", "updated"].includes(item.type) || @@ -1150,8 +1151,7 @@ export const dragFillCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, rowID, data }); - const iconElement = item.element.querySelector(".b3-menu__avemoji"); - item.element.innerHTML = renderCell(data, 0, iconElement ? !iconElement.classList.contains("fn__none") : false); + item.element.innerHTML = renderCell(data, 0, showIcon); renderCellAttr(item.element, data); delete item.colId; delete item.element; diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 35747db21..50770d415 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -728,7 +728,7 @@ export class WYSIWYG { return; } const originData: { [key: string]: IAVCellValue[] } = {}; - let lastOriginCellElement; + let lastOriginCellElement: HTMLElement; const originCellIds: string[] = []; nodeElement.querySelectorAll(".av__cell--active").forEach((item: HTMLElement) => { const rowElement = hasClosestByClassName(item, "av__row"); @@ -783,7 +783,7 @@ export class WYSIWYG { documentSelf.onselectstart = null; documentSelf.onselect = null; if (lastCellElement) { - dragFillCellsValue(protyle, nodeElement, originData, originCellIds); + dragFillCellsValue(protyle, nodeElement, originData, originCellIds, lastOriginCellElement); const allActiveCellsElement = nodeElement.querySelectorAll(".av__cell--active"); addDragFill(allActiveCellsElement[allActiveCellsElement.length - 1]); }