jquery/jquery-mobile — Issue #3702: JQM 1.1.0RC1 + Phonegap - tap delay
Author: pavliy
Created: 2012-03-01 14:01:35+00:00
State: open

Updated project from 1.0.1 to 1.1.0RC1.

**PhoneGap version:** 1.4.1

**Bug description:** when i tap the button or listview item etc. - highlight effect does not work.
But when i hold the button etc - effect appears.

**Video proof:** http://youtu.be/irMR5LGOCmY First 5 seconds i was clicking on the button. Starting from 6 - i hold left mouse button for some seconds and effect works.

**Page used to test:** http://dl.dropbox.com/u/6815935/home.html

**Tested on:** Android 2.2 emulator 800x480, Iphone 3 emulator non-retina, HTC Desire android 2.2, Apple Iphone 3GS IOS 4.3, Apple Iphone 4 IOS 5.
On desktop browsers everything is OK (Mozilla, Chrome, Safari, Opera, IE).

**Found problem:** The issue is in attachEvents function (string #4269).
There is hoverDelay = 200, that is used for all the events. The delay is also used in "vmousedown" event, seems to be unnecessary.

**Solution:** set 0 timeout to remove needed class when "vmousedown" event occures.

**Solution in code:** in attachEvents function, "vmousedown" handler:
```javascript
if( $.support.touch ) {
hov = setTimeout(function() {
$btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme );
}, 0 );//Here should be zero, not hoverDelay that is 200
} else {
$btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme );
}
```