Results 1 to 2 of 2

Thread: Container and passive:true webview android

  1. #1
    Sencha User
    Join Date
    Oct 2007
    Posts
    89
    Vote Rating
    -1
      0  

    Default Container and passive:true webview android

    Hi,

    I developped a sencha touch application with a container which contains a openlayer map.
    It work with android but since the compil 56 of google chrome on the scroll
    https://www.chromestatus.com/features/5093566007214080
    I show this error in the console log "Unable to preventDefault inside passive event listener due to target being treated as passive" because API launch
    e.preventDefault(); in a class Ext.viewport.Default in the function doPreventPanning.

    I would like find a simple and fast solution on my project, I would like add the properties passive:false in addEventListeners
    but I don't know how to do that.....

    Do you have a idea ? a another solution ?

    Thanks for your response.

  2. #2
    Sencha User
    Join Date
    Oct 2007
    Posts
    89
    Vote Rating
    -1
      0  

    Default

    If I change the functions as this, it works but sometimes it's slowing

    Code:
    doPreventPanning: function(e) {
            var target = e.target, touch;
    
            // If we have an interaction on a WebComponent we need to check the actual shadow dom element selected
            // to determine if it is an input before preventing default behavior
            // Side effect to this is if the shadow input does not do anything with 'touchmove' the user could pan
            // the screen.
            if (this.isInteractiveWebComponentRegEx.test(target.tagName) && e.touches && e.touches.length > 0) {
                touch = e.touches[0];
                if (touch && touch.target && this.isInputRegex.test(touch.target.tagName)) {
                    return;
                }
            }
    
           /* if (target && target.nodeType === 1 && !this.isInputRegex.test(target.tagName)) {
                e.preventDefault();
            }*/
    
            if (target && target.nodeType === 1 && !this.isInputRegex.test(target.tagName) && e.cancelable) {
              e.preventDefault();
            }
        } 
    
    
     addWindowListener: function(eventName, fn, capturing) {
          //window.addEventListener(eventName, fn, Boolean(capturing));
          window.addEventListener(eventName, fn, {
            capture: Boolean(capturing),
            passive: false
            });
        },
    
        removeWindowListener: function(eventName, fn, capturing) {
          // window.removeEventListener(eventName, fn, Boolean(capturing));
          window.removeEventListener(eventName, fn, {
            capture: Boolean(capturing),
            passive: false
          });
        }

Similar Threads

  1. Nothing show in Android Webview.
    By leebyeungok in forum Ext 6: Q&A
    Replies: 1
    Last Post: 16 Nov 2015, 1:30 AM
  2. Sencha Touch 2.0.1 in Android Webview
    By lsadiki in forum Sencha Touch 2.x: Q&A
    Replies: 4
    Last Post: 16 Jan 2013, 6:30 AM
  3. VERY SLOW interactions in android webview
    By mikxman in forum Sencha Touch 1.x: Charts
    Replies: 6
    Last Post: 10 Oct 2012, 6:31 AM
  4. Webview with backbutton on sencha for iOS/Android
    By duke9985 in forum Sencha Touch 2.x: Q&A
    Replies: 4
    Last Post: 8 Apr 2012, 9:56 PM
  5. Differences between browser and WebView on Android
    By vasion in forum Sencha Touch 1.x: Q&A
    Replies: 0
    Last Post: 3 Sep 2011, 2:55 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •