Hi everyone, I'm doing LIVE tests on my site and I noticed that on mobile the home page doesn't scroll when first loaded.
If I do a refresh everything is ok, just like if I go to mobile emulation from Chrome.
This is the link to the site if you want to try www.yoocare.net from your devices
I can recreate this 100% of the time. As soon as you accept the cookie consent it locks the page. Even on mobile, with the consent modal showing I can still scroll. As soon as I accept the cookie it locks the page in what ever spot it was scrolled to.
So something on your dismissal of the cookie consent modal is locking it.
Thanks for the replies.
Certainly the problem is created by the modal which applies the overflow hidden class as reported by famousmag.
At the moment I haven't found any other options to avoid the problem, so when accepting cookies I simply refresh.
I know it's not the best but it's just a temporary workaround.
Hey @enriweb77 do you know how to reproduce this on a new project?
I was able to see the error few days ago and I want to inspect it with android studio.
But now I can see you call the workaround function, so can't search the issue anymore
Hi France,
I actually didn't understand well when the problem appears.
I have several pages with modals with the same settings but some give this problem and others don't.
You can try to set the visibility of the modal based on a parameter when loading the page (in my case the parameter was the cookie).
Thanks for the research, it indeed seems to be a conflict with both the preloader and the modal code. The preloader does the same as a modal, it blocks the page and prevents scrolling untill the page finished loading. The modal does the same and both restore the state back afterwards. The problem is that they overlap, the preloader first sets overflow hidden and then directly after that the modal sets overflow to hidden. The page is loaded and the preloader restores the overflow allowing the page to scroll again (the reason why scroll works under the modal) and when the modal is closed it restores the state, but it restores it to overflow hidden since it was that when the modal was shown.
Not sure how to fix this, can't change the bootstrap code and only changing the preloader will not solve the issue. Workaround is to not use preloader or wait with showing the modal until page is loaded and preloader is hidden. Will see if I can perhaps update preloader to not use overflow hidden or do it in a way that doesn't conflict with the bootstrap modal.