Fix table size issue with some heuristics

This commit is contained in:
Laurent Nguyen 2024-07-10 19:14:13 +02:00
parent fa460bfba2
commit 5d59c47979
2 changed files with 5 additions and 2 deletions

View File

@ -447,6 +447,9 @@ export interface IDocumentsTabComponentProps {
// Extend DocumentId to include fields displayed in the table
type ExtendedDocumentId = DocumentId & { tableFields?: DocumentsTableComponentItem };
// This is based on some heuristics
const calculateOffset = (columnNumber: number): number => columnNumber * 13.71428571 - 46;
// Export to expose to unit tests
export const DocumentsTabComponent: React.FunctionComponent<IDocumentsTabComponentProps> = ({
isPreferredApiMongoDB,
@ -1901,7 +1904,7 @@ export const DocumentsTabComponent: React.FunctionComponent<IDocumentsTabCompone
style={
{
height: "100%",
width: "calc(100% - 50px)",
width: `calc(100% + ${calculateOffset(selectedColumnIds.length)}px)`,
} /* Fix to make table not resize beyond parent's width */
}
>

View File

@ -147,7 +147,7 @@ export const DocumentsTableComponent: React.FC<IDocumentsTableComponentProps> =
aria-label="Select column"
size="small"
icon={<MoreHorizontalRegular />}
style={{ position: "absolute", right: -6 }}
style={{ position: "absolute", right: 0 }}
/>
</MenuTrigger>
<MenuPopover>