Stopping the background scrolling whilst a modal popup is open

0
Hi all, Currently working on a system which involves using a modal popup to open an extra field when/if a profile is leaving the company. The page in the background has a scrollbar as it is longer than the screen though, so when i click and the popup opens, there is still a scrollbar in the background and it still works. Any way to "freeze" that background so it doesn't scroll whilst the modal popup is open?  Thanks! Ben
asked
3 answers
1

StackOverflow to the rescue!

https://stackoverflow.com/questions/9538868/prevent-body-from-scrolling-when-a-modal-is-opened

This (or any for that matter) addition to the css can be easily done using sass: https://www.mxblog.nl/2016/03/using-sass-with-mendix/

Good luck! 

answered
1

This is a bug. And a big one. Modal means modal. By definition the main-window and all its elements should be inactive, untouchable, non-interfering at all for as long as the modal window is still active. So your best bet is to report a bug at Mendix and have them solve this bug. Mendix will be a platform for it.

Alas a javascript-bugfix like the Stackoverflow example will probably work for you and you will be in the clear, but it would be so much better is Mendix would solve this. 

 

answered
0

Since no prior answers worked for me i solved the problem by some researches and found out you can add a style to a element if it contains a specific element. By this you can check your body if it contains a .modal-dialog and apply a style to it. Here’s what worked for me:

This should block the scrolling on pages automatically once you open a page with the popup type “Modal pop-up”.

 

Tested in Studio Version 9.24.2

answered