Results 1 to 3 of 3

Thread: Touch event breaks from 5.0.1 to 5.1.0

    Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha Premium Member
    Join Date
    Feb 2015
    Posts
    44

    Exclamation Touch event breaks from 5.0.1 to 5.1.0

    Ext version tested:
    • Ext 5.0.1 rev 1255
    • Ext 5.1.0 rev 107
    Device/Browsers tested against:
    • iPad/Safari
    • iPad/Chrome
    • Samsung Galaxy Tab 4/Native
    • Samsung Galaxy Tab 4/Chrome
    • Samsung Galaxy Tab 4/Firefox
    • Samsung Galaxy Tab 4/Opera
    Description:

    In 5.0.1, I got scrolling to work as expected (after eliminating Ext.Viewport) on touch devices.
    Updating to 5.1.0 creates an error at every touchdown on my main container.
    The website reported the exception location in the code of ext-all-debug.js, and I've added a few console.logs to see what is going on. It appears that the event (e.type) is reported as a mousedown, instead of touchstart, and listenerMap does not contain an entry for this event.

    Debug log 5.0.1:

    Version: 5.0.1.1255 Build date: 2014-08-05 20:14:52 (2852ec9b146a917f790d13cfa9b9c2fa041fccf8)

    Code:
    onEvent: function(e) {
             
            var me = this,
                browserEvent = e.browserEvent;
      
            if (!Ext.supports.Touch || me.getMouseEnabled() ||
                (!me.isMouseEvent[browserEvent.type] && browserEvent.pointerType !== 'mouse')) {
                console.log('browserEvent.type: ' + browserEvent.type);                 // added
                console.log('browserEvent.pointerType: ' + browserEvent.pointerType);   // added
                console.log('e.type: ' + e.type);                                       // added
                console.log('me.listenerMap[e.type]: ' + me.listenerMap[e.type]);       // added
                me[me.listenerMap[e.type]](e);
            }
        },
    Output:
    -----------------
    CONSOLE LOG FROM JS CLIENT: browserEvent.type: touchstart
    CONSOLE LOG FROM JS CLIENT: browserEvent.pointerType: undefined
    CONSOLE LOG FROM JS CLIENT: e.type: touchstart
    CONSOLE LOG FROM JS CLIENT: me.listenerMap[e.type]: onTouchStart
    -----------------

    Debug log 5.1.0:

    Version: 5.1.0.107 Build date: 2014-12-10 14:07:00 (2e9aed02ab6d3ef7b0ec406edea1e8581413381e)

    Code:
    onEvent: function(e) {
                      
            var me = this,
                browserEvent = e.browserEvent;
            if ((!me.self.isTouching || me.isTouching) && 
                
                
            ((!me.getTranslatable().isScrollParent) || (!me.isMouseEvent[browserEvent.type] && browserEvent.pointerType !== 'mouse')) && (me.getY() || me.getX())) {
                console.log('browserEvent.type: ' + browserEvent.type);                 // added
                console.log('browserEvent.pointerType: ' + browserEvent.pointerType);   // added
                console.log('e.type: ' + e.type);                                       // added
                console.log('me.listenerMap[e.type]: ' + me.listenerMap[e.type]);       // added
                me[me.listenerMap[e.type]](e);
            }
        },
    Output:
    ----------------
    CONSOLE LOG FROM JS CLIENT: browserEvent.type: touchstart
    CONSOLE LOG FROM JS CLIENT: browserEvent.pointerType: undefined
    CONSOLE LOG FROM JS CLIENT: e.type: mousedown
    CONSOLE LOG FROM JS CLIENT: me.listenerMap[e.type]: undefined
    CONSOLE LOG FROM JS CLIENT: Error message: TypeError: undefined is not a function (evaluating 'me[me.listenerMap[e.type]](e)')
    URL: http://(...)/extjs/js/ext-all-debug.js
    Line Number: 35355
    ----------------

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Thanks for the report. Can you please post a test case which reproduces this issue?
    https://fiddle.sencha.com/#home

  3. #3
    Sencha Premium Member
    Join Date
    Feb 2015
    Posts
    44

    Default

    I had a go at that before, but couldn't reproduce it in the fiddle environment. Our (business) application is too complex to simplify in a reasonable amount of time. I do know that this makes it harder for you, but given the detailed location in code and error description, I hope you will be able to reverse manufacture the situation as it is.

    There clearly are changes in the code from 5.0.1 to 5.1.0 in the onEvent method (and probably its caller methods), and I can reproduce the code working/failing by switching the versions of the ext-all-debug.js file.

    Best regards

Similar Threads

  1. [NOREPRO] Sencha touch 2.x application layout breaks on Google Chrome update 30
    By akhileshs in forum Sencha Touch 2.x: Bugs
    Replies: 1
    Last Post: 15 Oct 2013, 1:05 PM
  2. Ext 3.3 MIFrame 2.1 breaks CSS rules/ ext event handlers
    By zboris in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 8 Jun 2012, 9:00 AM
  3. [NOREPRO] Sencha Touch 2.0.1 RC breaks animating
    By Martin1982 in forum Sencha Touch 2.x: Bugs
    Replies: 11
    Last Post: 11 Apr 2012, 1:33 PM
  4. Sencha-touch-1.2.0-sync breaks localstorage?
    By stefankendall in forum Sencha Touch 1.x: Bugs
    Replies: 0
    Last Post: 25 Jan 2012, 7:27 PM
  5. [FIXED-109] modal/overlay option breaks touch events
    By crp_spaeth in forum Sencha Touch 1.x: Bugs
    Replies: 3
    Last Post: 28 Jun 2010, 1:52 PM

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
  •