Automatically resizing a popup

6
Hi all, This question has been asked once or twice before, but never with a (for me) usable answer.  Is there a (preferably not extremely hacky) way to get Mendix to automatically adjust the size of a popup based on its contents?  My use-case is simple. Most of the input for my current project is done through popups. These are all quite small (4 to 6 input fields) so no scrolling is involved. However, I do perform validation checks on the input. Whenever a validation message is shown, the popup content overflows, resulting in a scrollbar. This is both ugly and not user-friendly. I'd very much like the popup to auto-grow to accommodate the new content. Has anyone managed to find a way to achieve this? Kind regards, Chris
asked
3 answers
2

Hi Chris, I have resizable pop-ups in my project. The scroll bar only appears if the content is getting larger than your desktop screen. The way to do this is to place the content of the pop-up layout placed in a layout grid with class col-md-12. Let me know if this works.

answered
7

I've managed to track down the cause. It does not actually have anything to do with the layout grids (works fine with or without), but happened because I had set the width of the popup (not the height, mind you!) to 470 in the modeler. 

So fixing the width also apparently disabled the automatic resize function. A bug, I presume...

If you want to fix the width of your pop-ups; use a CSS class. 

answered
2

Hi Wilfried,

Your suggestion did not work for my current project (though I had removed all layout grids from the pop-ups, so it was worth a try), but when I ran a test with a clean project, it did. 

Must be something in the custom styling, though I haven't quite figured out what. Should be able to track it down though.

Thanks!

answered