function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Fergyl Dennis EstiocoFergyl Dennis Estioco 

Pages in Salesforce1 become blank after user interaction

Hello,
     
     In Salesforce1, some Visualforce pages in a mobile application become blank after a user selects an input element or when a user scrolls on the page. Elements on the page are still active after the user interacts with it (For instance, you can still click on different input elements and buttons), however the entire page is blank. This issue is occurring on a 4th gen iPad with iOS version 9.3.2 and SF1 app version 10.0.

     The known issue in this link describes what I'm experiencing, but it seems to be resolved already.

     Has anyone else experienced this issue as well? Are there any recommended methods of debugging this issue?

Thank you!

 

 

Best Answer chosen by Fergyl Dennis Estioco
Fergyl Dennis EstiocoFergyl Dennis Estioco

To anyone who may be experiencing this issue, there is a possible fix. Including this script at the top of the afflicted VF pages seems to prevent the error from occuring:

<script> 
(function(){
     try{
          var a=navigator.userAgent;
          if((a.indexOf('Salesforce')!=-1)&&(a.indexOf('iPhone')!=-1||a.indexOf('iPad')!=-1)&& (a.indexOf('OS/8')!=-1||a.indexOf('OS 8')!=-1||a.indexOf('OS/9')!=-1||a.indexOf('OS 9')!=-1)&&(a.indexOf('Safari')==-1)){ 
            var s=document.createElement('style'); 
            if(a.indexOf('OS/8')!=-1||a.indexOf('OS 8')!=-1) {
                s.innerHTML="html,html body{overflow: auto;-webkit-overflow-      scrolling:touch;}body{position:absolute;left:0;right:0;top:0;bottom:0;}";
            }
            else if(a.indexOf('OS/9')!=-1||a.indexOf('OS 9')!=-1) {
                s.innerHTML="html,html body{overflow: auto;-webkit-overflow-scrolling:auto;}body{position:absolute;left:0;right:0;top:0;bottom:0;}";
            }
            document.getElementsByTagName('head')[0].appendChild(s);}}catch(e){}})(); 
</script>

All Answers

Jeremy WortzmanJeremy Wortzman
Try placing the code below in a script tag at the top of your VF page .
 
<script>
           (function(){try{var a=navigator.userAgent;if((a.indexOf('Salesforce')!=-1)&&(a.indexOf('iPhone')!=-1||a.indexOf('iPad')!=-1)&&(a.indexOf('OS/8')!=-1||a.indexOf('OS 8')!=-1||a.indexOf('OS/9')!=-1||a.indexOf('OS 9')!=-1)&&(a.indexOf('Safari')==-1)){
            var s=document.createElement('style');
            if(a.indexOf('OS/8')!=-1||a.indexOf('OS 8')!=-1) {
                s.innerHTML="html,html body{overflow: auto;-webkit-overflow-scrolling:touch;}body{position:absolute;left:0;right:0;top:0;bottom:0;}";
            }
            else if(a.indexOf('OS/9')!=-1||a.indexOf('OS 9')!=-1) {
                s.innerHTML="html,html body{overflow: auto;-webkit-overflow-scrolling:auto;}body{position:absolute;left:0;right:0;top:0;bottom:0;}";
            }
            document.getElementsByTagName('head')[0].appendChild(s);}}catch(e){}})();
         </script>
 
Fergyl Dennis EstiocoFergyl Dennis Estioco

To anyone who may be experiencing this issue, there is a possible fix. Including this script at the top of the afflicted VF pages seems to prevent the error from occuring:

<script> 
(function(){
     try{
          var a=navigator.userAgent;
          if((a.indexOf('Salesforce')!=-1)&&(a.indexOf('iPhone')!=-1||a.indexOf('iPad')!=-1)&& (a.indexOf('OS/8')!=-1||a.indexOf('OS 8')!=-1||a.indexOf('OS/9')!=-1||a.indexOf('OS 9')!=-1)&&(a.indexOf('Safari')==-1)){ 
            var s=document.createElement('style'); 
            if(a.indexOf('OS/8')!=-1||a.indexOf('OS 8')!=-1) {
                s.innerHTML="html,html body{overflow: auto;-webkit-overflow-      scrolling:touch;}body{position:absolute;left:0;right:0;top:0;bottom:0;}";
            }
            else if(a.indexOf('OS/9')!=-1||a.indexOf('OS 9')!=-1) {
                s.innerHTML="html,html body{overflow: auto;-webkit-overflow-scrolling:auto;}body{position:absolute;left:0;right:0;top:0;bottom:0;}";
            }
            document.getElementsByTagName('head')[0].appendChild(s);}}catch(e){}})(); 
</script>
This was selected as the best answer