-
16 Aug 2012 2:28 PM #1
[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.Owner of 360releases Ltd. - Sencha Touch & Ext JS consulting
twitter.com/steffenhiller
extjswithrails.com, senchatouchbits.com
-
20 Aug 2012 6:36 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
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.
-
22 Aug 2012 2:12 AM #3
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:
e.stopPropagation() stops the event from bubbling to the textField.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();
-
22 Aug 2012 10:27 AM #4
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);
-
4 Nov 2012 10:58 AM #5
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.
-
4 Nov 2012 11:04 AM #6
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.
Owner of 360releases Ltd. - Sencha Touch & Ext JS consulting
twitter.com/steffenhiller
extjswithrails.com, senchatouchbits.com
-
4 Nov 2012 11:12 AM #7
-
4 Nov 2012 12:47 PM #8
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?
-
4 Nov 2012 12:59 PM #9
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?Owner of 360releases Ltd. - Sencha Touch & Ext JS consulting
twitter.com/steffenhiller
extjswithrails.com, senchatouchbits.com
-
4 Nov 2012 1:09 PM #10
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
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3287
in
2.2.


Reply With Quote
