Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3287 in 2.2.
  1. #1
    Ext JS Premium Member Steffen Hiller's Avatar
    Join Date
    Mar 2008
    Posts
    753
    Vote Rating
    20
    Steffen Hiller will become famous soon enough

      1  

    Default [2.1] Tap event is passed to the textfield in new view

    [2.1] Tap event is passed to the textfield in new view


    We have a list and when tapping on a list item that is at the same position as a textfield that is on the view which opens up on itemtap, the focus is directly set on that textfield on iOS for which it slides in the keyboard.

    Not sure if this happens in any 2.x version but this didn't happen on ST1 on the same app.

    Should I create a testcase?

    Thanks.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,641
    Vote Rating
    434
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    I know I've seen something like this before but cannot find it so I pushed to our bug tracker.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jul 2011
    Location
    Utrecht
    Posts
    84
    Vote Rating
    2
    DJFliX is an unknown quantity at this point

      0  

    Default


    As a workaround you can listen to the itemsingletap event instead of the itemtap event.

    This is now the start of the function that is executed on that event:
    Code:
    /** * Opens a message. This method is called when an itemtype event is received from an object with xtype messageslist.
     * @param {Ext.dataview.DataView} this
     * @param {Number} index The index of the item tapped
     * @param {Ext.Element/Ext.dataview.component.DataItem} target The element or DataItem tapped
     * @param {Ext.data.Model} record The record assosciated to the item
     * @param {Ext.EventObject} e The event object
     */
    onViewItemTap: function (instance, index, target, record, e) {
    	var a = this,
    		v;
    	e.stopPropagation();
    e.stopPropagation() stops the event from bubbling to the textField.

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Posts
    31
    Vote Rating
    0
    clabasky is on a distinguished road

      0  

    Default workaround

    workaround


    I get around this issue by disabling the textfield on the tap event, then setting a delayed task to enable the textfield again after 500 milliseconds



    Code:
    //disable the textfield
     Ext.ComponentQuery.query('#askfavpanel2 > fieldset > textfield')[0].setDisabled(true);
    //set the other panel active
    Ext.getCmp('askfavcard').setActiveItem(Ext.getCmp('askfavpanel2'));
    //create a delayed task 
               var task = Ext.create('Ext.util.DelayedTask',function(){
                                     Ext.ComponentQuery.query('#askfavpanel2 > fieldset > textfield')[0].setDisabled(false);                                 
                                     });
    // enable the textfield after 500 milliseconds, textfield won't listen to touch event bug
               task.delay(500);

  5. #5
    Sencha User
    Join Date
    Mar 2010
    Location
    Seattle, WA
    Posts
    137
    Vote Rating
    1
    wprater is on a distinguished road

      0  

    Default


    This issue has been plaguing us as well and the 500ms workaround is not an acceptable one as it causes jittery behavior on our app.

    Neither itemtap or singleitemtap are preventable, so Im not sure what the other poster was referring to.

    Also, using itemsingletap over itemtap is not a workaround either, as the problem still persists.

    Are we close on this one? What are others doing? This bug has been around for months now.

  6. #6
    Ext JS Premium Member Steffen Hiller's Avatar
    Join Date
    Mar 2008
    Posts
    753
    Vote Rating
    20
    Steffen Hiller will become famous soon enough

      0  

    Default


    Try adding e.stopEvent(); to the beginning of the itemtap handler. This worked for me. Sorry that I didn't post my work around earlier.

  7. #7
    Sencha User
    Join Date
    Mar 2010
    Location
    Seattle, WA
    Posts
    137
    Vote Rating
    1
    wprater is on a distinguished road

      0  

    Default


    Quote Originally Posted by Steffen Hiller View Post
    Try adding e.stopEvent(); to the beginning of the itemtap handler. This worked for me. Sorry that I didn't post my work around earlier.
    This works for me! Thanks for the reminder on #stopEvent.

  8. #8
    Sencha User
    Join Date
    Mar 2010
    Location
    Seattle, WA
    Posts
    137
    Vote Rating
    1
    wprater is on a distinguished road

      0  

    Default


    Similar behavior occurs when the keyboard has moved the view up. If you are to click away from an input field to a checkbox (for example), it will select the checkbox, but also activate a textfield that was in that position before the keyboard moved the view up.

    This happens on the kitchen sink forms example and is a serious UX issue.

    Anyone have a work around?

  9. #9
    Ext JS Premium Member Steffen Hiller's Avatar
    Join Date
    Mar 2008
    Posts
    753
    Vote Rating
    20
    Steffen Hiller will become famous soon enough

      0  

    Default


    I have one case in my app where I want that specific behavior where the following view catches the tap event so I didn't look into a general override yet. (And I haven't seen the case you describe yet, but I can imagine that this exists.)
    Maybe adding a e.stopEvent() to onTouchEnd in Ext.event.recognizer.Tap?
    Just a quick guess. Might break stuff like dragging/scrolling?

  10. #10
    Sencha User
    Join Date
    Mar 2010
    Location
    Seattle, WA
    Posts
    137
    Vote Rating
    1
    wprater is on a distinguished road

      0  

    Default


    Quote Originally Posted by Steffen Hiller View Post
    I have one case in my app where I want that specific behavior where the following view catches the tap event so I didn't look into a general override yet. (And I haven't seen the case you describe yet, but I can imagine that this exists.)
    Maybe adding a e.stopEvent() to onTouchEnd in Ext.event.recognizer.Tap?
    Just a quick guess. Might break stuff like dragging/scrolling?
    Good idea, I'll give that a shot. And I think you're right, it sounds like it could break scrolling...

    Here is an example of this happening in the Kitchen Sink. You can see that when I tap the radio button, it will select, but it also regains focus of where the other fields was before the keyboard popped up, causing this issue.

    Here is a video

    http://drop.superformula.com/2R2g2B3O2i2r