react-modal-dialog icon indicating copy to clipboard operation
react-modal-dialog copied to clipboard

Set the width and height of the dialog in percentages

Open SuhairZain opened this issue 8 years ago • 1 comments

Hi, Is it possible to set the width and height of the dialog to a certain percentage of the screen width? This the output when I try to do it.

screenshot from 2016-05-14 11 04 45

<ModalContainer onClose={this.handleClose}>
{
    this.state.isLoading ?
        <ReactSpinner/> :
        <ModalDialog style={{height: '50%',width: '70%'}} onClose={this.handleClose}>
            <BookItem {...this.state.book}/>
        </ModalDialog>
}
</ModalContainer>

I'd like to make the content fit within the reduced dialog. Is there any way to do it in the current version of react-modal-dialog? Also, this is the output if the content is large and I don't set any width and height for dialog:

screenshot from 2016-05-14 11 29 20

SuhairZain avatar May 14 '16 06:05 SuhairZain

Width works but not sure about height. I usually just let the content stretch the height out.

I'd be happy to take any pull requests that make this better though.

qimingweng avatar May 14 '16 14:05 qimingweng