Skip to content

Commit

Permalink
fix #1796
Browse files Browse the repository at this point in the history
  • Loading branch information
gpelouze committed Jan 27, 2025
1 parent 561d666 commit efa6382
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/components/src/VirtualizedList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Box from '@mui/material/Box';
import ListItem from '@mui/material/ListItem';
import ListItemButton from '@mui/material/ListItemButton';
import ListItemText from '@mui/material/ListItemText';
import { SxProps } from '@mui/material';

function Row(
{
Expand Down Expand Up @@ -38,13 +39,12 @@ function Row(
interface VirtualizedListProps {
clickAction: (index: number) => void;
items: [];
sx: SxProps;
}

export function VirtualizedList({ items, clickAction }: VirtualizedListProps) {
export function VirtualizedList({ items, clickAction, sx }: VirtualizedListProps) {
return (
<Box
sx={{ width: '100%', height: '100%', maxWidth: 360, bgcolor: 'background.paper', overflow: 'scroll' }}
>
<Box sx={sx}>
{items.map((item, index) => (
<Row
key={item['node_id']}
Expand Down
13 changes: 12 additions & 1 deletion packages/experiment-manager/src/components/CatalogDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,23 @@ export class CatalogDialog extends React.Component<CatalogDialogProps> {
disablePortal
id="combo-box-demo"
options={catalogs}
sx={{ width: 300, margin: '10px' }}
sx={{
width: 300,
margin: '10px',
height: '50px',
}}
renderInput={(params) => <TextField {...params} label="Catalog" />}
/>
<VirtualizedList
items={this.state.catalog_elements}
clickAction={this.onCellSelection}
sx={{
width: '100%',
height: 'calc(100% - 70px)',
maxWidth: 360,
bgcolor: 'background.paper',
overflow: 'scroll',
}}
/>
</div>
<PreviewWindow>
Expand Down

0 comments on commit efa6382

Please sign in to comment.