web: fix height of attachments table

This commit is contained in:
Abdullah Atta
2024-03-04 12:05:18 +05:00
parent 4281fb65e1
commit 03d18e9b13
2 changed files with 4 additions and 1 deletions

View File

@@ -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}>

View File

@@ -317,6 +317,7 @@ function AttachmentsDialog({ onClose }: AttachmentsDialogProps) {
}
mode="fixed"
estimatedSize={30}
headerSize={40}
getItemKey={(index) => attachments.key(index)}
items={attachments.placeholders}
context={{