mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 The menu no longer extends beyond the window
fix https://github.com/siyuan-note/siyuan/issues/15400
This commit is contained in:
parent
ce37930cc9
commit
1a0599d858
1 changed files with 2 additions and 1 deletions
|
|
@ -98,7 +98,8 @@ export class Menu {
|
|||
}
|
||||
const menuRect = menuElement.getBoundingClientRect();
|
||||
const itemsMenuRect = itemsMenuElement.getBoundingClientRect();
|
||||
const availableHeight = (window.innerHeight - menuRect.top) - (menuRect.height - itemsMenuRect.height);
|
||||
// 加 1px 是为了避免在特定情况下渲染出不应存在的滚动条而做的兼容处理
|
||||
const availableHeight = (window.innerHeight - menuRect.top) - (menuRect.height - itemsMenuRect.height) + 1;
|
||||
itemsMenuElement.style.maxHeight = Math.max(availableHeight, 0) + "px";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue