Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/15908

Vanessa4f7e524efe15
diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts
index e97d4480b4..dfada38ebe 100644
--- a/app/src/protyle/render/av/cell.ts
+++ b/app/src/protyle/render/av/cell.ts
@@ -497,16 +497,17 @@ export const popTextCell = (protyle: IProtyle, cellElements: HTMLElement[], type
cellRect = cellElements[0].getBoundingClientRect();
let html = "";
let height = cellRect.height;
- let style;
+ const cssStyle = getComputedStyle(cellElements[0]);
+ let style = `font-family:${cssStyle.fontFamily};font-size:${cssStyle.fontSize};line-height:${cssStyle.lineHeight};padding:${cssStyle.padding};position:absolute;top: ${cellRect.top}px;`;
if (contentElement) {
const contentRect = contentElement.getBoundingClientRect();
if (cellRect.bottom > contentRect.bottom) {
height = contentRect.bottom - cellRect.top;
}
const width = Math.min(Math.max(cellRect.width, 25), contentRect.width);
- style = `style="padding: ${viewType === "table" ? 6 : 3}px 8px;position:absolute;left: ${(cellRect.left < contentRect.left || cellRect.left + width > contentRect.right) ? contentRect.left : cellRect.left}px;top: ${cellRect.top}px;width:${width}px;height: ${height}px"`;
+ style = `style='height: ${height}px;width:${width}px;left: ${(cellRect.left < contentRect.left || cellRect.left + width > contentRect.right) ? contentRect.left : cellRect.left}px;${style}'`;
} else {
- style = `style="padding: ${viewType === "table" ? 6 : 3}px 8px;position:absolute;left: ${cellRect.left}px;top: ${cellRect.top}px;width:${Math.max(cellRect.width, 25)}px;height: ${height}px"`;
+ style = `style='height: ${height}px;width:${Math.max(cellRect.width, 25)}px;left: ${cellRect.left}px;${style}'`;
}
if (["text", "email", "phone", "block", "template"].includes(type)) {
@@ -552,10 +553,6 @@ export const popTextCell = (protyle: IProtyle, cellElements: HTMLElement[], type
const avMaskElement = document.querySelector(".av__mask");
const inputElement = avMaskElement.querySelector(".b3-text-field") as HTMLInputElement;
if (inputElement) {
- const style = getComputedStyle(cellElements[0]);
- inputElement.style.fontSize = style.fontSize;
- inputElement.style.lineHeight = style.lineHeight;
- inputElement.style.fontFamily = style.fontFamily;
if (["text", "email", "phone", "block", "template"].includes(type)) {
inputElement.value = cellElements[0].querySelector(".av__celltext")?.textContent || "";
}