Skip to content

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

:lipstick: fix https://github.com/siyuan-note/siyuan/issues/6450

Vanessa08859f198be3
diff --git a/app/src/assets/scss/_search.scss b/app/src/assets/scss/_search.scss
index a5cfb896ee..79baf7a8bd 100644
--- a/app/src/assets/scss/_search.scss
+++ b/app/src/assets/scss/_search.scss
@@ -20,6 +20,7 @@
}
.b3-menu {
+ max-width: 70%;
max-height: 50vh;
overflow: auto;
top: 48px;
diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts
index 7565aa2d2a..c733048194 100644
--- a/app/src/layout/Wnd.ts
+++ b/app/src/layout/Wnd.ts
@@ -515,8 +515,9 @@ export class Wnd {
}).element);
});
window.siyuan.menus.menu.popup({
- x: event.clientX - 16,
+ x: event.clientX,
y: event.clientY,
+ w: 16
});
}
diff --git a/app/src/menus/Menu.ts b/app/src/menus/Menu.ts
index 703662c459..1df70b74ba 100644
--- a/app/src/menus/Menu.ts
+++ b/app/src/menus/Menu.ts
@@ -76,7 +76,7 @@ export class Menu {
this.element.innerHTML = "";
this.element.removeAttribute("data-filetreeid"); // 用于标记文档数右键所选文档 https://ld246.com/article/1667311960383
this.element.classList.add("fn__none");
- this.element.removeAttribute("style")
+ this.element.removeAttribute("style"); // 页签下拉需要设置 overflow 和 max-height
}
public append(element?: HTMLElement) {
@@ -86,7 +86,7 @@ export class Menu {
this.element.append(element);
}
- public popup(options: { x: number, y: number, h?: number }, isLeft = false) {
+ public popup(options: { x: number, y: number, h?: number , w?: number }, isLeft = false) {
if (this.element.innerHTML === "") {
return;
}
@@ -97,7 +97,7 @@ export class Menu {
}
this.element.classList.remove("fn__none");
- setPosition(this.element, options.x - (isLeft ? window.siyuan.menus.menu.element.clientWidth : 0), options.y, options.h);
+ setPosition(this.element, options.x - (isLeft ? window.siyuan.menus.menu.element.clientWidth : 0), options.y, options.h, options.w);
}
}
diff --git a/app/src/menus/commonMenuItem.ts b/app/src/menus/commonMenuItem.ts
index 7428168fde..bba84b0250 100644
--- a/app/src/menus/commonMenuItem.ts
+++ b/app/src/menus/commonMenuItem.ts
@@ -266,7 +266,9 @@ export const openFileAttr = (attrs: IObject, id: string, focusName = "bookmark")
});
}
window.siyuan.menus.menu.element.style.zIndex = "310";
- window.siyuan.menus.menu.popup({x: event.clientX, y: event.clientY + 16});
+ window.siyuan.menus.menu.element.style.overflow = "auto";
+ window.siyuan.menus.menu.element.style.maxHeight = "60vh";
+ window.siyuan.menus.menu.popup({x: event.clientX, y: event.clientY + 16, w: 16});
});
break;
}
@@ -471,7 +473,9 @@ export const openAttr = (nodeElement: Element, protyle: IProtyle, focusName = "b
});
}
window.siyuan.menus.menu.element.style.zIndex = "310";
- window.siyuan.menus.menu.popup({x: event.clientX, y: event.clientY + 16});
+ window.siyuan.menus.menu.element.style.overflow = "auto";
+ window.siyuan.menus.menu.element.style.maxHeight = "60vh";
+ window.siyuan.menus.menu.popup({x: event.clientX, y: event.clientY + 16, w: 16});
});
break;
}