Skip to content

Commit 7328fc1

Browse files
authored
fix: The sticky header was being rendered via a portal to the top of the page (#235)
layout for all databases. For inline databases embedded in documents, this caused a duplicate header - one at the top of the page and one inside the grid.
1 parent c22568e commit 7328fc1

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

src/components/database/components/grid/grid-table/GridVirtualizer.tsx

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -194,27 +194,29 @@ function GridVirtualizer({ columns }: { columns: RenderColumn[] }) {
194194
);
195195
})}
196196
</div>
197-
<DatabaseStickyTopOverlay>
198-
<GridStickyHeader
199-
// eslint-disable-next-line
200-
// @ts-ignore
201-
row={{
202-
index: 0,
203-
}}
204-
ref={stickyHeaderRef}
205-
columns={columns}
206-
data={data}
207-
totalSize={totalSize}
208-
columnItems={columnItems}
209-
onScrollLeft={(scrollLeft) => {
210-
parentRef.current?.scrollTo({
211-
left: scrollLeft,
212-
behavior: 'auto',
213-
});
214-
}}
215-
onResizeColumnStart={handleResizeStart}
216-
/>
217-
</DatabaseStickyTopOverlay>
197+
{!isDocumentBlock && (
198+
<DatabaseStickyTopOverlay>
199+
<GridStickyHeader
200+
// eslint-disable-next-line
201+
// @ts-ignore
202+
row={{
203+
index: 0,
204+
}}
205+
ref={stickyHeaderRef}
206+
columns={columns}
207+
data={data}
208+
totalSize={totalSize}
209+
columnItems={columnItems}
210+
onScrollLeft={(scrollLeft) => {
211+
parentRef.current?.scrollTo({
212+
left: scrollLeft,
213+
behavior: 'auto',
214+
});
215+
}}
216+
onResizeColumnStart={handleResizeStart}
217+
/>
218+
</DatabaseStickyTopOverlay>
219+
)}
218220

219221
<DatabaseStickyBottomOverlay scrollElement={virtualizer.scrollElement}>
220222
<DatabaseStickyHorizontalScrollbar

0 commit comments

Comments
 (0)