Skip to content

Commit b3f6c40

Browse files
committed
:lipsticks: #12707
1 parent 8d20f37 commit b3f6c40

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/src/protyle/render/av/action.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
229229
event.stopPropagation();
230230
return true;
231231
} else if (target.classList.contains("av__calc")) {
232-
openCalcMenu(protyle, target);
232+
openCalcMenu(protyle, target, undefined, event.clientX - 64);
233233
event.preventDefault();
234234
event.stopPropagation();
235235
return true;

app/src/protyle/render/av/calc.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const openCalcMenu = async (protyle: IProtyle, calcElement: HTMLElement,
7979
data: IAV,
8080
colId: string,
8181
blockID: string
82-
}) => {
82+
}, x?: number) => {
8383
let rowElement: HTMLElement | false;
8484
let type;
8585
let colId: string;
@@ -403,7 +403,7 @@ export const openCalcMenu = async (protyle: IProtyle, calcElement: HTMLElement,
403403
});
404404
}
405405
const calcRect = calcElement.getBoundingClientRect();
406-
menu.open({x: calcRect.left, y: calcRect.bottom, h: calcRect.height});
406+
menu.open({x: Math.max(x || 0, calcRect.left), y: calcRect.bottom, h: calcRect.height});
407407
};
408408

409409
export const getCalcValue = (column: IAVColumn) => {

0 commit comments

Comments
 (0)