Reduce delay while selecting option in jquery mobi

2019-08-21 09:30发布

问题:

I have my application installed on an Android Device Samsung S4 which is built using Intel XDK. I have a select dropdown in the form having 40 options. When i tap on an option to choose, it chooses the option instantly but takes 2 seconds of delay before closing the opened options popup.

I have tried the following fix but it did not work as expected.

$(document).bind("mobileinit", function(){
    $.mobile.buttonMarkup.hoverDelay = 0;
    $.mobile.selectmenu.prototype.options.nativeMenu = true; //i also changed to false and didn't work either
});

Is there any other fix i can apply to reduce or remove the lag between choosing an option and closing the option box?

回答1:

Although this didn't work for me

$.mobile.selectmenu.prototype.options.nativeMenu = false;

But adding data-native-menu="false" to the select element it worked fine

<select name="year" id="year" data-theme="a" data-native-menu="false">