Skip to content

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

:bug: Keep table cell appearance below selection https://github.com/siyuan-note/siyuan/issues/18537

Daniel19d3660afe76
diff --git a/app/src/protyle/toolbar/tableCell.ts b/app/src/protyle/toolbar/tableCell.ts
index c4f645b083..06ee2175fb 100644
--- a/app/src/protyle/toolbar/tableCell.ts
+++ b/app/src/protyle/toolbar/tableCell.ts
@@ -36,7 +36,16 @@ export const openTableCellAppearance = (protyle: IProtyle, cellElements: HTMLTab
limitRecentFontStyleRows(appearanceElement);
protyle.toolbar.subElementCloseCB = undefined;
const rect = cells[0].getBoundingClientRect();
- setPosition(protyle.toolbar.subElement, rect.left, rect.top);
+ const gap = 4;
+ const top = rect.bottom + gap;
+ const availableHeight = Math.max(0, window.innerHeight - top);
+ appearanceElement.style.maxHeight = `${availableHeight}px`;
+ const overflowHeight = Math.max(0, protyle.toolbar.subElement.offsetHeight - availableHeight);
+ if (overflowHeight > 0) {
+ appearanceElement.style.maxHeight = `${Math.max(0, appearanceElement.offsetHeight - overflowHeight)}px`;
+ }
+ setPosition(protyle.toolbar.subElement, rect.left, top);
+ protyle.toolbar.subElement.style.top = `${top}px`;
};
export const getTableCellTextStyleMenus = (protyle: IProtyle, cellElements: HTMLTableCellElement[],