diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts index 996e9f263..ce4b83901 100644 --- a/app/src/protyle/render/av/action.ts +++ b/app/src/protyle/render/av/action.ts @@ -156,7 +156,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle const cellElement = hasClosestByClassName(event.target, "av__cell"); if (cellElement && !cellElement.parentElement.classList.contains("av__row--header")) { const type = cellElement.parentElement.parentElement.firstElementChild.querySelector(`[data-col-id="${cellElement.getAttribute("data-col-id")}"]`).getAttribute("data-dtype") as TAVCol; - if (type === "updated" || type === "created") { + if (type === "updated" || type === "created" || (type === "block" && !cellElement.getAttribute("data-detached"))) { selectRow(cellElement.parentElement.querySelector(".av__firstcol"), "toggle"); } else { selectRow(cellElement.parentElement.querySelector(".av__firstcol"), "unselect"); diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index 43260a144..a34dfaf98 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -457,19 +457,21 @@ const updateCellValue = (protyle: IProtyle, type: TAVCol, cellElements: HTMLElem if (type === "template") { const colId = cellElements[0].getAttribute("data-col-id"); const textElement = avMaskElement.querySelector(".b3-text-field") as HTMLInputElement; - transaction(protyle, [{ - action: "updateAttrViewColTemplate", - id: colId, - avID, - data: textElement.value, - type: "template", - }], [{ - action: "updateAttrViewColTemplate", - id: colId, - avID, - data: textElement.dataset.template, - type: "template", - }]); + if (textElement.value !== textElement.dataset.template) { + transaction(protyle, [{ + action: "updateAttrViewColTemplate", + id: colId, + avID, + data: textElement.value, + type: "template", + }], [{ + action: "updateAttrViewColTemplate", + id: colId, + avID, + data: textElement.dataset.template, + type: "template", + }]); + } } else { cellElements.forEach((item) => { const rowElement = hasClosestByClassName(item, "av__row");