Salesforce1 Mobile App on iOS 8: Taps not correctly registering on Visualforce pages

Customers using the Salesforce1 Mobile app on devices running iOS 8 may experience issues interacting with content on Visualforce pages. Specifically, tapping on a button or input field. Here are some workarounds.

Technology is always a moving target as new new devices, operating systems and software are released. Such is the case with the release of iOS 8 in September. Customers using the Salesforce1 Mobile app on devices running iOS 8 may experience issues interacting with content on Visualforce pages. Specifically, tapping on a button or input field. Touch events on the page may work intermittently, causing tap gestures to not be correctly registered.

Until this issue is resolved, customers on affected devices can access the Salesforce1 Mobile app using the Safari mobile browser. (Please note that there are some differences between the features and functionality available in the Salesforce1 iOS app and the mobile browser version of Salesforce1.)

Developer Workarounds

If you are a developer working with the Salesforce1 Mobile app, you can try one of the two workarounds suggested below. Note, however, that the following workarounds are not guaranteed to work, not supported by Salesforce, and should be used at your own risk. We are sharing this information proactively to help customers workaround a bug present in the iOS 8.0 and 8.0.2 releases:

Reproduction

  • Open the Salesforce1 iOS app on a device running iOS 8.
  • Navigate to a Visualforce page.
  • Tap on a checkbox, input field or other input area. The tap may not register (nothing happens) or the page may jump to the wrong spot.

Workaround
Again this information is being shared proactively to help developers workaround a bug present in the iOS 8.0 and 8.0.2 releases:

1) Add the following JavaScript to your 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('Safari')==-1)){ 
   var s=document.createElement('style'); 
   s.innerHTML="html,html body{overflow: auto;-webkit-overflow-scrolling:touch;}body{position:absolute;left:0;right:0;top:0;bottom:0;}"; 
   document.getElementsByTagName('head')[0].appendChild(s);
   }
   }catch(e){}})();
</script>

2) Add the following JavaScript to your page:

<script> 
   var ua=navigator.userAgent; 
   if((ua.indexOf('Salesforce')!=-1)&&(ua.indexOf('iPhone')!=-1||ua.indexOf('iPad')!=-1)&&(ua.indexOf('OS/8')!=-1||ua.indexOf('OS 8')!=-1)&&(ua.indexOf('Safari')==-1)){ 

   function IOS_SCROLL_BOOTSTRAP() { 
      var children = Array.prototype.slice.call(document.body.children), 
      placeholder = document.createElement('section'), 
      fragment = document.createDocumentFragment(), 
      styles, 
      width, 
      height; 
      children.forEach(function(c){fragment.appendChild(c);}); 
      placeholder.appendChild(fragment); 
      styles = [ 
       'width:100%;', 
       'height:', (window.screen.height - 42), 'px;', 
       'position: absolute; overflow: auto; -webkit-overflow-scrolling: touch' 
      ].join(''); 
      placeholder.style.cssText = styles; 
      document.body.appendChild(placeholder); 
   } 
   window.addEventListener('load', function (e) { 
   IOS_SCROLL_BOOTSTRAP(); 
}); 
}
</script>
Published
October 10, 2014

Leave your comments...

Salesforce1 Mobile App on iOS 8: Taps not correctly registering on Visualforce pages