Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: fix height of attachments table

Abdullah Attae35f3c5a9669
diff --git a/apps/web/src/components/virtualized-table/index.tsx b/apps/web/src/components/virtualized-table/index.tsx
index 303dd89a1..d18c083be 100644
--- a/apps/web/src/components/virtualized-table/index.tsx
+++ b/apps/web/src/components/virtualized-table/index.tsx
@@ -36,6 +36,7 @@ type VirtualizedTableProps<T, C> = {
mode?: "fixed" | "dynamic";
items: T[];
estimatedSize: number;
+ headerSize: number;
getItemKey: (index: number) => string;
scrollElement?: Element | null;
context?: C;
@@ -50,6 +51,7 @@ export function VirtualizedTable<T, C>(props: VirtualizedTableProps<T, C>) {
getItemKey,
scrollElement,
scrollMargin,
+ headerSize,
renderRow: Row,
estimatedSize,
mode,
@@ -76,7 +78,7 @@ export function VirtualizedTable<T, C>(props: VirtualizedTableProps<T, C>) {
<Box
ref={containerRef}
sx={{
- height: virtualizer.getTotalSize()
+ height: virtualizer.getTotalSize() + headerSize
}}
>
<table style={style}>
diff --git a/apps/web/src/dialogs/attachments-dialog.tsx b/apps/web/src/dialogs/attachments-dialog.tsx
index 796de1f73..d40525aaa 100644
--- a/apps/web/src/dialogs/attachments-dialog.tsx
+++ b/apps/web/src/dialogs/attachments-dialog.tsx
@@ -317,6 +317,7 @@ function AttachmentsDialog({ onClose }: AttachmentsDialogProps) {
}
mode="fixed"
estimatedSize={30}
+ headerSize={40}
getItemKey={(index) => attachments.key(index)}
items={attachments.placeholders}
context={{