Skip to content

Commit

Permalink
Dialog Math.max for px only
Browse files Browse the repository at this point in the history
  • Loading branch information
Vikram710 committed Apr 17, 2021
1 parent b1a65cf commit 98ffba6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/material-ui/src/Dialog/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ const DialogPaper = experimentalStyled(
}),
/* Styles applied to the Paper component if `maxWidth="xs"`. */
...(styleProps.maxWidth === 'xs' && {
maxWidth: Math.max(theme.breakpoints.values.xs, 444),
maxWidth:
theme.breakpoints.unit === 'px'
? Math.max(theme.breakpoints.values.xs, 444)
: `${theme.breakpoints.values.xs}${theme.breakpoints.unit}`,
[`&.${dialogClasses.paperScrollBody}`]: {
[theme.breakpoints.down(Math.max(theme.breakpoints.values.xs, 444) + 32 * 2)]: {
maxWidth: 'calc(100% - 64px)',
Expand Down

0 comments on commit 98ffba6

Please sign in to comment.