Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flickering of dropdown lists in Android (appverse)

I'm developing a mobile application on Appverse (multiplatform webkit container, like phonegap) and it works very smooth on iOS. However, I've found serious problems when using the same application on Android.

The dropdowns are displayed correctly, but when I click on them the native dropdown (roller) appears and disappears in a fraction of second.

Any clue about what could happen?

The application is using jQuery Mobile, and the dropdowns are specifically native. (In the last test, I'm using a plain HTML page, as the following one, with the same results)

EDIT: The tested HTML code into the WebView is simply this one:

 <html>
   <head></head>
   <body><form>
      <select id='myoptions'>
        <option>Option 1</option>
        <option>Option 2</option>
        <option>Option 3</option>
      </select>
   </form></body>
 </html>
like image 803
opalenzuela Avatar asked Oct 21 '22 04:10

opalenzuela


1 Answers

(Answering my own post)

After reading tons and tons of logs, I've found the reason of this problem. This happens because the application goes to background when the software keyboard appears and this forces the dropdown -contained in the Webview- to close. Similar issue here:

WebView hides soft keyboard during loadUrl(), which means a keyboard cannot stay open while calling javascript

Since the problem has been detected only in certain versions of Android, I'll workaround it by using the dropdown UI of jQueryMobile. Ugly, slow, fragile... but it works.

like image 125
opalenzuela Avatar answered Oct 31 '22 10:10

opalenzuela