Skip to content

Commit

Permalink
:lipsticks: siyuan-note#12707
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Nov 23, 2024
1 parent 8d20f37 commit b3f6c40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/src/protyle/render/av/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions app/src/protyle/render/av/calc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit b3f6c40

Please sign in to comment.