Skip to content

Commit a4e9ac2

Browse files
committed
💄 The menu no longer extends beyond the window
fix #15400
1 parent 16d3b65 commit a4e9ac2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

app/src/assets/scss/component/_menu.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
}
170170

171171
&__items {
172-
max-height: 80vh;
172+
max-height: min(80vh, calc(100vh - 20px - var(--b3-menu-position-top, 0px))); // 20px 是 .b3-menu 的上下 padding
173173
overflow: auto;
174174
padding: 0 8px;
175175
}

app/src/menus/Menu.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export class Menu {
146146
this.element.style.zIndex = (++window.siyuan.zIndex).toString();
147147
this.element.classList.remove("fn__none");
148148
setPosition(this.element, options.x - (options.isLeft ? this.element.clientWidth : 0), options.y, options.h, options.w);
149+
this.element.style.setProperty("--b3-menu-position-top", this.element.style.top);
149150
}
150151

151152
public fullscreen(position: "bottom" | "all" = "all") {

0 commit comments

Comments
 (0)