Skip to content

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

:lipsticks: https://github.com/siyuan-note/siyuan/issues/12707

Vanessab3f6c40835a0
diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts
index 88cca8a8fc..db45d3b8e8 100644
--- a/app/src/protyle/render/av/action.ts
+++ b/app/src/protyle/render/av/action.ts
@@ -229,7 +229,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
event.stopPropagation();
return true;
} else if (target.classList.contains("av__calc")) {
- openCalcMenu(protyle, target);
+ openCalcMenu(protyle, target, undefined, event.clientX - 64);
event.preventDefault();
event.stopPropagation();
return true;
diff --git a/app/src/protyle/render/av/calc.ts b/app/src/protyle/render/av/calc.ts
index cdb2b3ef1b..d5a365953c 100644
--- a/app/src/protyle/render/av/calc.ts
+++ b/app/src/protyle/render/av/calc.ts
@@ -79,7 +79,7 @@ export const openCalcMenu = async (protyle: IProtyle, calcElement: HTMLElement,
data: IAV,
colId: string,
blockID: string
-}) => {
+}, x?: number) => {
let rowElement: HTMLElement | false;
let type;
let colId: string;
@@ -403,7 +403,7 @@ export const openCalcMenu = async (protyle: IProtyle, calcElement: HTMLElement,
});
}
const calcRect = calcElement.getBoundingClientRect();
- menu.open({x: calcRect.left, y: calcRect.bottom, h: calcRect.height});
+ menu.open({x: Math.max(x || 0, calcRect.left), y: calcRect.bottom, h: calcRect.height});
};
export const getCalcValue = (column: IAVColumn) => {