dynamic resizing instead of initheight and initwidth
neovan opened this issue · 5 comments
Hi Folks,
Its a nice modal. But I am unable to resize the modal by funtion instead of manually?
The resizing itself works fine for me. but how to call it externally by function?
Regards,
Sebastian
Hi Neovan,
Thank you for your feedback. Currently, you can resize the modal manually.
What is the use case of resizing the modal by function? Also what parameters you want to pass to the resize function?
sad to read. I am using this wonderful modal as a better replacement for the standard modals which aren´t so good in dragging.
Actually, I have dynamic content which i would like to display.
For Example: It starts with a logon box and after submitting the form within the modal ....
The content of the modal changes to a form with a bunch of textboxes and other thins. Therefore it is neccessary to change the modal size programmatically.
I'v added a method called 'resize'. Now you can make a ref to this modal and call resize(width, height) to change the modal's width and height. Hope it can help.
Example:
<ReactModal
ref={child => {
this.child = child;
}}
initWidth={800}
initHeight={400}>
<button onClick={() => this.child.resize(100, 200)}>resize modal</button>
</ReactModal>
you are my hero, works like a charm 👍
now it´s really resizable :)
No worries :)