-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React not recognising Dialog prop 'paperWidthMd' #11692
Comments
👋 Thanks for using Material-UI! We use the issue tracker exclusively for bug reports and feature requests, however, If you would like to link from here to your question on SO, it will help others find it. |
@MikeB2012 There is no such property. |
Then I'm having trouble interpreting the CSS API at the bottom of the page: https://material-ui.com/api/dialog/ The property also shows up at line 29 here: https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Dialog/Dialog.js where it is not a 'root' property but it is a 'paper' property. Is it possible to alter any of the Dialog paper props inline? |
@MikeB2012 Have a look at the override documentation: https://material-ui.com/customization/overrides/ |
I have been trying to use 'overriding with inline styles' but was unsuccessful with Dialog unlike other components eg. Button, ListItem, etc. that were all straightforward. Is it possible then to use inline styles to override the non-root properties of Dialog? |
@MikeB2012 You won't be able to override 100% of the style with inline-style. It's not something we aim at. But that should work for most. For instance with the dialog, you can use |
Tnx for the assist Olivier. I've not had any luck with PaperProps even in codesandbox eg. setting padding, min-width, , etc. In the end I wrapped content in a div and applied styles to that which seems to work. |
@MikeB2012 Alternatively, you can try to give the |
This is my component. I was trying to change the width of a dialog from the default. The docs suggested I could do so by using 'paperWidthMd'
Expected Behavior
I expected the Dialog to accept the prop and set the dimension to paper width 'md'.
Current Behavior
I get the following error:
warning.js?da67:33 Warning: React does not recognize the
paperWidthMdprop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase
paperwidthmdinstead. If you accidentally passed it from a parent component, remove it from the DOM element. in div (created by Modal) in Portal (created by Modal) in Modal (created by WithStyles(Modal)) in WithStyles(Modal) (created by Dialog) in Dialog (created by WithStyles(Dialog)) in WithStyles(Dialog) (at render.jsx:120) in div (at render.jsx:92) in UI in MuiThemeProvider
Steps to Reproduce (for bugs)
Context
My intention is to expand the size of the dialog box and ideally add padding. Since this a change in a single instance of the Dialog in the code, I intended to make the change inline vice creating a new Dialog component using classes per the docs. Right now the Paper exactly fits the text in the dialog box with no padding, so I'm trying to style it.
Your Environment
The text was updated successfully, but these errors were encountered: