Disable touch on tablet webview

Posted by: m.chiodi on 10 October 2024, 5:45 am EST

    • Post Options:
    • Link

    Posted 10 October 2024, 5:45 am EST

    I would like to understand how it is possible to disable touch for the entire spreadsheet if it is inside a webview, in my case in an iPadOS app. Basically, I want to disable the ability to scroll the table with fingers.

  • Posted 14 October 2024, 4:20 am EST

    Hi,

    I am currently working on your request and checking with the Apple Ipad. I will update you about my findings soon.

    Regards,

    Ankit

  • Posted 15 October 2024, 6:07 am EST

    Hi,

    You could use the following code snippet to disable the scrolling on the IPad Devices:

    // Function to detect if the device is an iPad
    function isIPad() {
      return /iPad|Macintosh/.test(navigator.userAgent) && 'ontouchend' in document;
    }
    
    spread.getHost().addEventListener('touchmove', function (event) {
      if (isIPad()) {
        event.stopPropagation();
      }
    }, true);

    I have tested with the following configurations:

    IPadOS Version: 16.4.1
    Model Name: iPad (9th Generation)

    Sample: https://jscodemine.mescius.io/share/D1BdzQmdWkC4MbveSAOWkw/?defaultOpen={"OpenedFileName"%3A["%2Fsrc%2Fapp.js"]%2C"ActiveFile"%3A"%2Fsrc%2Fapp.js"}

    Let me know if you face any issues.

    Regards,

    Ankit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels