Material-ui: [Dialog] How to override padding

Created on 3 Oct 2015  路  5Comments  路  Source: mui-org/material-ui

I was able to override the absolute style; however, I cannot override the padding or padding top style on this component.

bug 馃悰

Most helpful comment

@nickhallph Not sure if your comments around your personal skillset / struggles with a component library are needed on a repository issue board.

All 5 comments

@Dindaleon if you're referring to the padding of the body of the dialog, then you can override that using the bodyStyle attribute of your Dialog component.

On the other hand, if you're referring to the padding of the dialog itself from the top of the window, see #1748. Let me know if you're not able to get it working!

@Dindaleon : Were you able to resolve this using the above suggestion?
I am closing this for now. Feel free to comment below if its not.

bodyStyle with { paddingTop: '0px(!important)' } doesn't work. // Pseudo code

The style attribute will add the styles to the parent div, allowing me to access it, but I still can't over ride the dynamic top padding x.x

Can't lie, MUI is not what I thought it was. Using MUI has made my life hell. So many things it does without your permission and so hard to tell it what to do. I would not recommend MUI for any project that isn't small, especially not a professional level application.

Solution:

<Dialog
  repositionOnUpdate={false}
  style={{ padding: '0px 0px 0px 0px' }}
/>

You have to set repositionOnUpdate to false AND add your paddingTop to the style attribute.

@nickhallph Not sure if your comments around your personal skillset / struggles with a component library are needed on a repository issue board.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

reflog picture reflog  路  3Comments

activatedgeek picture activatedgeek  路  3Comments

ericraffin picture ericraffin  路  3Comments

mb-copart picture mb-copart  路  3Comments

chris-hinds picture chris-hinds  路  3Comments