Fix table coming off its container with unwanted horizontal scrollbar

This commit is contained in:
Laurent Nguyen 2024-04-23 11:04:35 +02:00
parent 86926f2d7b
commit 49a9f4d596

View File

@ -1457,12 +1457,12 @@ const DocumentsTabComponent: React.FunctionComponent<{
<div <div
className="tab-pane active" className="tab-pane active"
/* data-bind=" /* data-bind="
setTemplateReady: true, setTemplateReady: true,
attr:{ attr:{
id: tabId id: tabId
}, },
visible: isActive" visible: isActive"
*/ */
role="tabpanel" role="tabpanel"
style={{ display: "flex" }} style={{ display: "flex" }}
> >
@ -1551,9 +1551,9 @@ const DocumentsTabComponent: React.FunctionComponent<{
onClick={() => refreshDocumentsGrid(true)} onClick={() => refreshDocumentsGrid(true)}
disabled={!applyFilterButton.enabled} disabled={!applyFilterButton.enabled}
/* data-bind=" /* data-bind="
click: refreshDocumentsGrid.bind($data, true), click: refreshDocumentsGrid.bind($data, true),
enable: applyFilterButton.enabled" enable: applyFilterButton.enabled"
*/ */
aria-label="Apply filter" aria-label="Apply filter"
tabIndex={0} tabIndex={0}
> >
@ -1565,9 +1565,9 @@ const DocumentsTabComponent: React.FunctionComponent<{
<button <button
className="filterbtnstyle queryButton" className="filterbtnstyle queryButton"
/* data-bind=" /* data-bind="
visible: !isPreferredApiMongoDB && isExecuting, visible: !isPreferredApiMongoDB && isExecuting,
click: onAbortQueryClick" click: onAbortQueryClick"
*/ */
aria-label="Cancel Query" aria-label="Cancel Query"
tabIndex={0} tabIndex={0}
> >
@ -1599,24 +1599,27 @@ const DocumentsTabComponent: React.FunctionComponent<{
<div style={{ overflow: "hidden", height: "100%" }}> <div style={{ overflow: "hidden", height: "100%" }}>
<Split> <Split>
<div style={{ minWidth: 200, width: "20%" }} ref={tableContainerRef}> <div style={{ minWidth: 200, width: "20%" }} ref={tableContainerRef}>
<DocumentsTableComponent <div style={{ height: "100%", width: "calc(100% - 50px)" }}>
style={{ width: 200 }} {" "}
items={tableItems} {/* Fix to make table not resize beyond parent's width */}
onItemClicked={onDocumentClicked} <DocumentsTableComponent
onSelectedRowsChange={onSelectedRowsChange} items={tableItems}
selectedRows={selectedRows} onItemClicked={onDocumentClicked}
size={tableContainerSizePx} onSelectedRowsChange={onSelectedRowsChange}
columnHeaders={columnHeaders} selectedRows={selectedRows}
onRefreshClicked={refreshDocumentsGrid} size={tableContainerSizePx}
/> columnHeaders={columnHeaders}
<a onRefreshClicked={refreshDocumentsGrid}
className="loadMore" />
role="button" <a
onClick={() => loadNextPage(false)} className="loadMore"
onKeyDown={() => loadNextPage(false)} role="button"
> onClick={() => loadNextPage(false)}
Load more onKeyDown={() => loadNextPage(false)}
</a> >
Load more
</a>
</div>
</div> </div>
<div style={{ minWidth: "20%", width: "100%" }}> <div style={{ minWidth: "20%", width: "100%" }}>
{selectedDocumentContent && selectedRows.size <= 1 && ( {selectedDocumentContent && selectedRows.size <= 1 && (