[SalesForce] Disable parent page scrolling in Salesforce1 for iOS

I'm having issues with scrolling on a custom Visualforce page that is displayed as a Salesforce1 app on iOS. I've noticed that the Visualforce page is loaded in an iframe on the Salesforce1 app, and scrolling up/down on the page sometimes scrolls the parent page instead of the iframe. This appears to only be happening on iOS and not Android.

Has anyone run into this issue and is there a way to disable the scrolling outside the iframe? It doesn't seem like I can access the parent page properties from within the iframe since the domains don't match.

Best Answer

I've found that most of the rendering/scrolling issues around iOS and Salesforce1 can be resolved by opening the Visualforce page in the child browser rather than through the usual mechanism which iframes it into the regular Salesforce1 page.

I wrote up a blog post of a few of the scenarios that this fixes at:

http://bobbuzzard.blogspot.co.uk/2014/03/salesforce1-and-visualforce-things-i.html

in your case you'd need a thin Visualforce page that executes the JavaScript to open the real Visualforce page via a window.open() call. Depending on what your app does, this may not be a suitable workaround (you lose the sforce.one object, for example, so navigation to Salesforce1 specific pages isn't available.

Related Topic