Skip to content

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

:bug: Keep inline font family menu anchored to its selector https://github.com/siyuan-note/siyuan/issues/17336

Danielc5b77782a3a2
diff --git a/app/src/protyle/toolbar/fontFamilyMenu.ts b/app/src/protyle/toolbar/fontFamilyMenu.ts
index 65d3bf6695..d414f9afb8 100644
--- a/app/src/protyle/toolbar/fontFamilyMenu.ts
+++ b/app/src/protyle/toolbar/fontFamilyMenu.ts
@@ -311,7 +311,7 @@ export const openFontFamilyMenu = async (target: HTMLElement, options: IFontFami
});
const rect = target.getBoundingClientRect();
target.setAttribute("aria-expanded", "true");
- menu.open({x: rect.right, y: rect.top, h: rect.height});
+ menu.open({x: rect.left, y: rect.bottom, h: rect.height, w: rect.width, target});
menu.element.querySelector(".b3-menu__items")?.setAttribute("style", "overflow: initial");
menu.element.querySelector<HTMLInputElement>('[data-type="font-family-search"]')?.focus();
};