I wanted to disable scrolling on mobile whenever a popup is shown by setting the body to position: fixed. This had the desired effect of stopping scrolling on the body element but I remove position:fixed when the user closes the popup. Going from position: fixed to relative or static moves the screen to the top of the page. This is not what I want – I want the user to be where they were on the page at the point when they opened the popup.
You’ll need to show some code so that someone here can better troubleshoot the issue.
At a base level though, I wonder if it might not be due to how you’re allowing users to close the page? For example, if you use something like <a href="#null" id="close-popup"> the #null bit might force the browser to scroll back up to the top as it seeks a matching target.