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?
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?
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