Results 1 to 2 of 2

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

Hybrid View

Previous Post Previous Post   Next Post Next Post
    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
    Vote Rating

    Default 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

    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.
    -    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
    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)
    document.addEventListener('touchstart', function(){}, false);

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


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

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