PDA

View Full Version : Tap delay on list items and erroneous firing of event for double tap (1.0.1a)



wdonne
1 Mar 2011, 3:27 AM
Hi,

I have a list in a panel that is configured as follows:

{
disableSelection: true,
itemTpl:
'<table class="library-item"><tr><td><img src="{icon}"/></td>' +
'<td>{title}</td></tr></table>',
onItemDisclosure: true,
store: libraries,
xtype: 'list',
listeners:
{
disclose: {fn: editLibrary},
itemtap: {fn: openLibrary}
}
}

When tapping an item or a disclosure button there is a long delay before the event actually fires. Doing a double tap fires it immediately, while it shouldn't fire at all. This indicates there may be something wrong with the double tap detection logic.

This happens on iPhone and iPad. In Safari on the desktop there is no such problem with click events.

Best regards,

Werner Donné.

wdonne
2 Mar 2011, 2:53 AM
The delay seems to occur when the contents of the main panel is changed like when switching cards in a card layout panel. If you just display an alert in the event handler then there is no delay.

When the delay occurs it is variable in duration.

ralf
3 Mar 2011, 11:48 AM
I also experienced a long dealy/need to click more than once in a comparable situation.
I could "solve" it by adding a stupid timeout:



onItemDisclosure: function (record, node, idx ) {
setTimeout(function(){Ext.dispatch({controller:'myctrl',action:'myaction'}); },50);
}

Worked for me.

wdonne
4 Mar 2011, 12:11 AM
Thanks for the tip Ralf!

Werner.

dreamdu5t
27 Jun 2011, 2:17 PM
I'm also experiencing this issue. It happens when calling Ext.dispatch() from the tap event bound to a list item.

What is causing this delay?

dreamdu5t
27 Jun 2011, 2:31 PM
I found the cause of the delay:

The "pressedDelay" config option for list components defaults to 100ms. Set it to 1 to avoid the delay.

Sencha Devs: This should really default to 0, it's counter-intuitive to add a delay by default.

So:

var list = new Ext.List({
store: app.store.people,
pressedDelay: 1,
onItemTap: function (list, index, item, e) {
var record = this.store.getAt(index);
Ext.dispatch({
controller: app.controllers.people,
action: 'detail',
id: record.getId()
});
}
});