diff --git a/app/src/protyle/render/av/blockAttr.ts b/app/src/protyle/render/av/blockAttr.ts index 3ec224b26..4d7d9ef42 100644 --- a/app/src/protyle/render/av/blockAttr.ts +++ b/app/src/protyle/render/av/blockAttr.ts @@ -56,6 +56,9 @@ export const genAVValueHTML = (value: IAVCellValue) => { `; break; + case "checkbox": + html = ``; + break; case "template": html = `
${value.template.content}
`; break; @@ -76,9 +79,17 @@ export const renderAVAttribute = (element: HTMLElement, id: string, protyle?: IP key: { type: TAVCol, name: string, - options?: { name: string, color: string }[] + options?: { + name: string, + color: string + }[] }, - values: { keyID: string, id: string, blockID: string, type?: TAVCol & IAVCellValue } [] + values: { + keyID: string, + id: string, + blockID: string, + type?: TAVCol & IAVCellValue + } [] }[], blockIDs: string[], avID: string @@ -128,6 +139,13 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone"].includes event.preventDefault(); return; } + const checkboxElement = hasClosestByAttribute(target, "data-type", "checkbox"); + if (checkboxElement) { + popTextCell(protyle, [checkboxElement], "checkbox"); + event.stopPropagation(); + event.preventDefault(); + return; + } }); element.querySelectorAll(".b3-text-field--text").forEach((item: HTMLInputElement) => { item.addEventListener("change", () => { diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index e7b219720..ff5ca7e8d 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -339,13 +339,17 @@ const updateCellValue = (protyle: IProtyle, type: TAVCol, cellElements: HTMLElem id, data: blockElement.getAttribute("updated"), }); - updateAttrViewCellAnimation(item); + if (!hasClosestByClassName(cellElements[0], "custom-attr")) { + updateAttrViewCellAnimation(item); + } }); } if (doOperations.length > 0) { transaction(protyle, doOperations, undoOperations); } - cellElements[0].classList.add("av__cell--select"); + if (!hasClosestByClassName(cellElements[0], "custom-attr")) { + cellElements[0].classList.add("av__cell--select"); + } if (blockElement) { focusBlock(blockElement); }