Prevent scroll after sidebar is open on ipad/touch-devices?

I am using a push-menu on my website for smaller screens, and when the menu is open i prevent vertical scrolling of the site with overflow-y: hidden; and it works perfect on my laptop. However if I open the website on my tablet or phone I can still scroll down with my fingers. Why isn’t overflow-y: hidden working on touchdevices? And how can i fix this?

On laptop it works like if the user clicks the hamburger (menu-icon) a class with overflow-y: hidden is added to the body.


On the iphone this works:

html,body {overflow-y:hidden;height:100%}

I believe some android versions don’t like overflow-y so you may need to use overflow instead.