4

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.

2

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.

2
  • Thanks. I just tried this and the Visualforce page is still loaded in an iframe in the browser. It's not quite as touchy as it was within the Salesforce1 app, but I still get the full page scroll instead of scrolling inside the iframe sometimes. Do you know of a way to disable the full page scroll up/down in iOS browsers?
    – Clint
    Apr 23 '14 at 20:33
  • There are ways to stop a page from scrolling in the iOS browser, but they typically rely on disabling some touch functionality as well, so not always that useful. There's more information at: stackoverflow.com/questions/2890361/… However, in this case I'm not sure that will do the trick, as the page is still contained inside the Salesforce1 app and you can't get at the outer containing page to change its scrolling behaviour, so you might need to wait until Salesforce fix this. Apr 24 '14 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.