Search code examples
androidcordovadropdownfastclick

Cordova App - Dropdown instant close


I've read some posts (github, stackoverflow, etc.) about this kind of issue, but I don't really get the right solution.

I'm creating a Cordova app* and I'm testing it on an Android 4.3 and I've some issue with the dropdown ( html tag). When I touch the select the option list open and close instantly.

The problem seems to come from fastclick.js cause when I remove it, it works ok but it looks not really good (as you know).

What could you advice me to do to fix it ?

Big thanks.


Code Sample :

onDeviceReady: function() {             
    // Fixing the Status Bar Issue on iOS7
    StatusBar.overlaysWebView( false );
    StatusBar.backgroundColorByHexString('#ffffff');
    StatusBar.styleDefault();

    // Avoiding the 300ms Click Delay
    //FastClick.attach(document.body);
    [...]
}

App details :

  • Base on the Apache Cordova Tutorial
  • Ratchet Components
  • Replace content with jQuery

Solution

  • I can confirm, it was due to Fastclick. I added the needsclick class on my SELECT tags and it fixed the issue.

    Thanks for your time.

    E.