Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
320 views
in Technique[技术] by (71.8m points)

html - <select> not working in Phonegap app on Android 2.3.3

I'm working on Phonegap app for Android and iOS. Most of the stuff works pretty well but I'm experiencing a problem with <select> tag. It's enhanced with jQuery mobile and on that version of Android when the appropriate div is clicked / tapped the options are not showing up. They show up when I do two clicks / taps:

  1. on a div containing <select>
  2. on a area above the div

In that scenario options show up and when selected change event is fired and code bind to it is executed.

I found these two android issues: http://code.google.com/p/android/issues/detail?id=10280 and http://code.google.com/p/android/issues/detail?id=6721

I have tried the workarounds mentioned there but they don't change anything. I still have to do two clicks but it's not the behavior I'm after. I only need one click.

Issue exists only on Android 2.3.3 and I think on older versions too. On iOS and newer Androids everything works perfectly fine.

I'm struggling with this issue whole day and tried everything.

Any help, tips would be heavily appreciated. Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Did You try adding data-native-menu="false" attribute to the select menu.

Example:

<select name="gender" id="gender" data-theme="b" data-native-menu="false" >
    <option value="">Please specify ...</option>
    <option value="option1">Male</option>
    <option value="option2">Female</option>
    <option value="option3">Undisclosed</option>
</select>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...