You found a bug! We've classified it as TOUCH-4411 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Jan 2009
    Posts
    10
    Vote Rating
    0
    dtnghia is on a distinguished road

      0  

    Default After upgrading to ST 2.2.0, app doesn't response to touch event on iOS 4.3.3

    After upgrading to ST 2.2.0, app doesn't response to touch event on iOS 4.3.3


    My application was working fine with ST 2.1.0 but after upgrading to ST 2.2.0, it's not working properly on iOS 4.3.3.
    After loading and rendering the UI, the app doesn't response to touch event.
    Tap on buttons, list items doesn't work anymore.

    The same problem with Sencha Touch Demo Apps in version 2.2.0.
    Open below link on my iPod Touch to view GeoCongress app
    http://docs.sencha.com/touch/2.2.0/t...ess/index.html

    I'm using iPod Touch device for testing, you can see my device userAgent below
    "Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8J2"

    After spending two days to debug and troubleshot, I found the root cause of this bug.
    It's because of the changes on Ext.event.publisher.Dom, see below diffs.
    Code:
     
    -    attachListener: function(eventName) {
    -        document.addEventListener(eventName, this.onEvent, !this.doesEventBubble(eventName));
    +    bindListeners: function (doc, bind) {
    +        var handlesEvents = this.getHandledEvents(),
    +            handlesEventsLength = handlesEvents.length,
    +            i;
    +
    +        for (i = 0; i < handlesEventsLength; i++) {
    +            this.bindListener(doc, this.getVendorEventName(handlesEvents[i]), bind);
    +        }
    +    },
    +
    +    bindListener: function (doc, eventName, bind) {
    +        if (bind) {
    +            this.attachListener(eventName, doc);
    +        } else {
    +            this.removeListener(eventName, doc);
    +        }
    +        return this
    +    },
    +
    +    attachListener: function(eventName, doc) {
    +        if (!doc) {
    +            doc = document;
    +        }
    +
    +        var defaultView = doc.defaultView,
    +            addEventListener;
     
    +        if (defaultView && defaultView.addEventListener) {
    +            addEventListener = defaultView.addEventListener;
    +        }
    +        else {
    +            addEventListener = doc.addEventListener;
    +        }
    +        addEventListener(eventName, this.onEvent, !this.doesEventBubble(eventName));
             return this;
         },
    Somehow, document.defaultView.addEventListener doesn't work as expected on iOS 4.3.3 with touchstart event so application won't be able to get any touch event from browser.
    If I remove the new changes in attachListener method and use the old code in 2.1.0, everything is working fine again
    Code:
    document.addEventListener(eventName, this.onEvent, !this.doesEventBubble(eventName));
    If you need a quick work around solution, then add this line of code to the top of your application (app.js)
    Code:
    document.addEventListener('touchstart', function(){}, false);
    or
    Code:
    ocument.ontouchstart=function(){};

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,144
    Vote Rating
    855
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.