Material-ui: [Dialog] Fullscreen

Created on 28 Sep 2015  路  10Comments  路  Source: mui-org/material-ui

Is there a way for the dialog to go fullscreen (no overlay)? this would be handy for a phone view where space is limited.

Dialog

Most helpful comment

1467 works for the width. I'm also looking to so max out the height.

I tried

contentStyle={{width: "100%", maxWidth: "none",height:"100%",maxHeight:"100%"}}

I also tried

contentStyle={{width: "100%", maxWidth: "none",height:"2000",maxHeight:"2000"}} //set to a high number for testing

Roughly something like this:
https://www.google.com/design/spec/components/dialogs.html#dialogs-full-screen-dialogs

All 10 comments

Seems like a duplicate of #1467

Feel free to re-open and comment if you're trying to do something else.

1467 works for the width. I'm also looking to so max out the height.

I tried

contentStyle={{width: "100%", maxWidth: "none",height:"100%",maxHeight:"100%"}}

I also tried

contentStyle={{width: "100%", maxWidth: "none",height:"2000",maxHeight:"2000"}} //set to a high number for testing

Roughly something like this:
https://www.google.com/design/spec/components/dialogs.html#dialogs-full-screen-dialogs

@timarney see the screenshot below:
screen shot 2015-09-29 at 10 39 26 am

Dialogs will expand according to the size of the content. As for manually setting the height to the entire screen, I haven't yet found a way to do so _without_ modifying the source. I wouldn't recommend this but you can set the height of the paper element here like so:

paper: {
        background: this.state.muiTheme.rawTheme.palette.alternateTextColor,
        height: '1000', //or whatever you like
      },

Okay good to know.

Looks like I can set the container position by passing in paddingTop + turning off repositionOnUpdate
https://github.com/callemall/material-ui/blob/master/src/dialog.jsx#L364

Based on your screen any idea what pushes the 'white' part of the Dialog down i.e. not covering the menu?

Found it ... I can move it up by passing a negative number for top.

I should be able to get working now.

Thanks for the help.

:+1:

@timarney could you chance post a sample of how you pulled it off? looking for the same m'self

@lefnire I took a look and that part of the code (referenced) was either removed or was part of a demo ... anyway I couldn't track it down.

Did you take a look at https://github.com/callemall/material-ui/blob/master/docs/src/app/components/pages/components/Dialog/ExampleCustomWidth.js ?

That example is for the width but maybe try passing a value for 'top' in the customContentStyle variable.

bodyStyle prop in Dialog will have height disappear and maxHeight overwritten with the calculated maxheight available via dialog.js

It automatically gives max-height via window.innerHeight - 2 * 64 for dialog padding

if you have title or actionbuttons it will remove respective sum of the heightoffset values in componentDidMount via a ref

since I have non-standard padding and passed nonstandard value for contentStyle top (for desired space maximizaiton/fullscreen mode) the window.innerHeight -2 * 64 part is taking an extra 128 pix off my necessary value.

i just added a min-width of my calculated values and pass into bodyStyle and it works.. because min-height is after in teh inline style. i worry some browser might take priority over max-height in the inline style and thus waiting for better solution here hopefully

image

I used the Modal util (https://material-ui.com/utils/modal/) to create a full-height ModalImage

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ryanflorence picture ryanflorence  路  3Comments

mattmiddlesworth picture mattmiddlesworth  路  3Comments

iamzhouyi picture iamzhouyi  路  3Comments

activatedgeek picture activatedgeek  路  3Comments

newoga picture newoga  路  3Comments