Skip to content

React not recognising Dialog prop 'paperWidthMd' #11692

@MikeB2012

Description

@MikeB2012

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'

                 <Dialog open={searching} maxWidth="md" paperWidthMd>
			<DialogTitle>
				{localization.get("org_staff_add")}
			</DialogTitle>
                            ...
			<DialogActions>
				{search_actions}
			</DialogActions>
		</Dialog>
  • This is a v1.x issue (v0.x is no longer maintained).
  • I have searched the issues of this repository and believe that this is not a duplicate.

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 lowercasepaperwidthmd instead. 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)

  1. Create Dialog component
  2. Attempt to control Paper size using 'paperWidthMd'
  3. Tried using the prop here: https://codesandbox.io/s/v033qjxyz7 and while I don't get a warning it does seem like the prop is simply ignored.

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

Tech Version
Material-UI v1.?.?
React ~16.3.0
browser Version 66.0.3359.181 (Official Build) (64-bit)
etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions