Skip to content

Commit 85efaa2

Browse files
committed
fix: fix Table hidden by errors panel
In scenario view, tables could be hidden when an errors panel was visible. This commits adds a minimum height for the table and a scrollbar to make it always visible. Other minor changes have been added to keep the correct height in fullscreen and when a '100%' height is provided in the component props (e.g. in the 'dataset details' dialog).
1 parent 0bf3aac commit 85efaa2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/inputs/Table/Table.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const useStyles = makeStyles((theme) => ({
5555
right: 'auto',
5656
bottom: 'auto',
5757
position: 'fixed',
58+
height: '100%',
5859
width: '100%',
5960
// z-index for the fullscreen container must be higher than 1200 to hide the app bar and drawers, but lower than
6061
// 1300 to still appear under modals & tooltips (see https://mui.com/material-ui/customization/z-index/ for details)
@@ -374,7 +375,7 @@ export const Table = (props) => {
374375
id="table-container"
375376
data-cy="table-input"
376377
{...otherProps}
377-
style={{ height }}
378+
style={{ height, overflow: 'auto' }}
378379
className={isDirty ? classes.dirtyInput : isDirty === false ? classes.notDirtyInput : ''}
379380
>
380381
<div data-cy="label">
@@ -391,7 +392,7 @@ export const Table = (props) => {
391392
<div
392393
data-cy="grid"
393394
id="grid-container"
394-
style={{ height: `calc(100% - ${TABLE_TOOLBAR_HEIGHT})` }}
395+
style={{ height: height === '100%' ? '100%' : undefined }}
395396
className={`${agTheme} ${isFullscreen && classes.fullscreenGridContainer}`}
396397
>
397398
<div
@@ -405,7 +406,7 @@ export const Table = (props) => {
405406
>
406407
{errorsPanelElement}
407408
{tableToolbarElement}
408-
<Box style={{ flex: '1 0 0', overflow: 'auto' }} sx={{ width: width ?? '100%' }}>
409+
<Box style={{ flex: '1 0 0', overflow: 'auto', minHeight: '200px' }} sx={{ width: width ?? '100%' }}>
409410
{isReady && !isLoading ? agGridElement : tablePlaceholder}
410411
</Box>
411412
</div>

0 commit comments

Comments
 (0)