vodkabears/Remodal

Opening of Modal Scrolling to Top of Page

nrly opened this issue · 3 comments

nrly commented

Hey,

First up thanks for your great modal script.

I'm having the same issue described here #20.

However using min-height doesn't work in terms of keeping my #header div 100%. Currently set up as html, body {height: 100%;} and #header {min-height:100%;}. If I change html,body to min-height it doesn't fill the screen however the modal works correctly any doesn't scroll to the top of the page.

Is there any fix for this without having to remove height:100% ??

Thanks in advance!

@nrly in the remodal's CSS file remove overflow:hidden of the remodal_lock class or write in your styles: html, body { overflow: auto !important }. This solution will save scrollbar, but fix scrolling of the viewport.

nrly commented

Awesome! Thanks so much the quick reply this seems to have fixed it perfectly.

Hi, I have the same issue and have implemented the fix as suggested above, while this does stop the page from jumping up the top, it does cause other issues, most notably, the background content is scrollable and depending on how the keyboard opens and closes, some of the background is revealed.

keyboard_off