mirror of
https://github.com/docmost/docmost.git
synced 2026-07-27 20:04:44 +10:00
feat(base): make column headers sticky in standalone and inline contexts
Split the unified .gridWrapper into a sticky band (containing column headers, plus banner + toolbar in inline) and a body grid that owns horizontal scroll. The band's vertical sticky anchor is automatic CSS: the table's scrollport in standalone, the page in inline. A small useHorizontalScrollSync hook mirrors body scrollLeft onto the header and turns wheel-on-header into pan-on-body.
This commit is contained in:
@@ -32,10 +32,12 @@ function applyExtension(wrapper: HTMLDivElement) {
|
||||
// column into empty space — same behaviour as Notion, gives the
|
||||
// table breathing room on the right when scrolled fully right.
|
||||
wrapper.style.setProperty("--embed-grid-pad-right", `${extendRight}px`);
|
||||
// Drop the standalone "panel" frame: inline databases read as part
|
||||
// of the document, with only cell separators as gridlines.
|
||||
wrapper.style.setProperty("--grid-outer-border", "none");
|
||||
wrapper.style.setProperty("--grid-outer-radius", "0");
|
||||
// Inline sticky band clears the fixed PageHeader. Standalone leaves
|
||||
// the var unset (resolves to the rule default of 0).
|
||||
wrapper.style.setProperty(
|
||||
"--sticky-band-top",
|
||||
"var(--page-header-height)",
|
||||
);
|
||||
}
|
||||
|
||||
export function BaseEmbedView({ node }: NodeViewProps) {
|
||||
|
||||
Reference in New Issue
Block a user