From baadad6119ff2bfbd12790e7595a114dcd2ed05a Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 15 May 2024 11:34:03 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/11389 --- app/src/protyle/render/av/cell.ts | 3 ++- app/src/protyle/render/av/relation.ts | 3 ++- app/src/protyle/render/av/select.ts | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index d219f643d..f4f5b20b5 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -542,7 +542,8 @@ export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, va return; } if (!nodeElement.contains(item)) { - item = cellElements[elementIndex] = nodeElement.querySelector(`.av__row[data-id="${rowElement.dataset.id}"] .av__cell[data-col-id="${item.dataset.colId}"]`) as HTMLElement; + item = cellElements[elementIndex] = (nodeElement.querySelector(`.av__row[data-id="${rowElement.dataset.id}"] .av__cell[data-col-id="${item.dataset.colId}"]`) || + nodeElement.querySelector(`.fn__flex-1[data-col-id="${item.dataset.colId}"]`)) as HTMLElement; } if (!item) { // 兼容新增行后台隐藏 diff --git a/app/src/protyle/render/av/relation.ts b/app/src/protyle/render/av/relation.ts index 0b708da7e..c388e5c37 100644 --- a/app/src/protyle/render/av/relation.ts +++ b/app/src/protyle/render/av/relation.ts @@ -352,7 +352,8 @@ export const setRelationCell = (protyle: IProtyle, nodeElement: HTMLElement, tar return; } if (!nodeElement.contains(cellElements[0])) { - cellElements[0] = nodeElement.querySelector(`.av__row[data-id="${rowElement.dataset.id}"] .av__cell[data-col-id="${cellElements[0].dataset.colId}"]`) as HTMLElement; + cellElements[0] = (nodeElement.querySelector(`.av__row[data-id="${rowElement.dataset.id}"] .av__cell[data-col-id="${cellElements[0].dataset.colId}"]`) || + nodeElement.querySelector(`.fn__flex-1[data-col-id="${cellElements[0].dataset.colId}"]`) ) as HTMLElement; } const newValue: IAVCellRelationValue = {blockIDs: [], contents: []}; menuElement.querySelectorAll('[draggable="true"]').forEach(item => { diff --git a/app/src/protyle/render/av/select.ts b/app/src/protyle/render/av/select.ts index 446e75b76..bc4a1a4da 100644 --- a/app/src/protyle/render/av/select.ts +++ b/app/src/protyle/render/av/select.ts @@ -449,7 +449,8 @@ export const addColOptionOrCell = (protyle: IProtyle, data: IAV, cellElements: H cellElements.forEach((item, index) => { const rowElement = hasClosestByClassName(item, "av__row"); if (rowElement) { - cellElements[index] = blockElement.querySelector(`.av__row[data-id="${rowElement.dataset.id}"] .av__cell[data-col-id="${item.dataset.colId}"]`) as HTMLElement; + cellElements[index] = (blockElement.querySelector(`.av__row[data-id="${rowElement.dataset.id}"] .av__cell[data-col-id="${item.dataset.colId}"]`) || + blockElement.querySelector(`.fn__flex-1[data-col-id="${item.dataset.colId}"]`) ) as HTMLElement; } }); }