Skip to content

Commit

Permalink
Move dialog scroll fix to theme config to apply it everywhere
Browse files Browse the repository at this point in the history
This fix can be removed after a new patch of Material UI with mui/material-ui#43626 is released.
  • Loading branch information
viliket committed Sep 8, 2024
1 parent 22139fb commit 7dd5cc7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/components/StationAndTrainSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,6 @@ export default function StationAndTrainSearch() {
open={open}
onClose={handleClose}
TransitionComponent={SlideUpTransition}
PaperProps={{
sx: {
// Temporary fix until new patch of MUI is released with https://github.com/mui/material-ui/pull/43626
overflowY: 'auto',
},
}}
>
<AppBar position="fixed" elevation={0}>
<Toolbar>
Expand Down
17 changes: 17 additions & 0 deletions src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,23 @@ const baseTheme: CssVarsThemeOptions = {
},
},
},
MuiDialog: {
styleOverrides: {
root: {
variants: [
{
props: { scroll: 'paper' },
style: {
'& .MuiPaper-root': {
// Temporary fix until new patch of MUI is released with https://github.com/mui/material-ui/pull/43626
overflowY: 'auto',
},
},
},
],
},
},
},
},
};

Expand Down

0 comments on commit 7dd5cc7

Please sign in to comment.