Reputation: 1126
In the image below, you can see padding-right
and overflow
inline styles that have been added to the <body>
element when the Dialog was opened.
How can I prevent Material-UI from adding those styles to the body element?
Upvotes: 2
Views: 1043
Reputation: 81156
This functionality is part of Modal
(used by Dialog
) and is implemented here.
You can turn this off by adding the disableScrollLock
prop to your Dialog
.
Example:
<Dialog
disableScrollLock
onClose={handleClose}
aria-labelledby="simple-dialog-title"
open={open}
>
...
</Dialog>
Documentation: https://material-ui.com/api/modal/#props
Upvotes: 4