Known Issue: Scrolling on a SharePoint Page Viewer Web Part using a Mobile Device does not Work

  • 16 February 2021
  • 0 replies
  • 272 views

Badge +6
 

Known Issue: Scrolling on a SharePoint Page Viewer Web Part using a Mobile Device does not Work

KB001760

PRODUCT
K2 blackpearl 4.6.11
K2 smartforms 4.6.11
BASED ON
K2 blackpearl 4.6.11
LEGACY/ARCHIVED CONTENT
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.

 

Issue:

SmartForms can be inserted in SharePoint pages using K2 Form Viewer or K2 SmartForms Viewer, which inherits from the SharePoint Page Viewer web part.  When the form is viewed on a mobile device, such as an iPad, the scroll bar is not available which makes the form unusable. To resolve this issue, you must enable page scrolling by adding a script to the SharePoint page hosting the K2 Form Viewer. Follow the steps detailed in the workaround below:

 

Workaround:

  1. As a SharePoint administrator edit the SharePoint page that contains the K2 Forms Viewer web part.
  2. In the ribbon choose Insert -> Embed Code.
  3. Paste the following code:
    Note: 
    1. The sample script below shows the configuration for an iPad. Customize the script if you are using a different mobile device.
    2. The widths and heights in the script can be adjusted to ensure the form displays correctly on the targeted devices.
     
    <script type="text/javascript">
    var is_iPad = navigator.userAgent.match(/iPad/i) != null;
    function _fixIframeScrolling()
    {
        var iframe = document.getElementsByTagName("iframe")[0];
        iframe.setAttribute("scrolling", "yes");
        iframe.height = "100%";
        iframe.width = "100%";
        iframe.style.cssText = "display:block;";
        iframe.parentElement.style.cssText = "height: 450px; width: 750px; max-width: 750px; max-height: 450px; overflow: auto; -webkit-overflow-scrolling: touch;";
        iframe.parentElement.parentElement.style.cssText = "height: 460px; width: 760px;";
    }
    if(is_iPad)
    {
    _spBodyOnLoadFunctionNames.push("_fixIframeScrolling")
    }
    </script>
  4. Click Insert.
  5. Save the page.

 


0 replies

Be the first to reply!

Reply