{ "id": "130360", "key": "TIMOB-17139", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2016-04-20T07:51:40.000+0000", "created": "2014-05-13T16:14:38.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "webview" ], "versions": [ { "id": "16904", "description": "Release 5.0.2", "name": "Release 5.0.2", "archived": true, "released": true, "releaseDate": "2015-10-01" } ], "issuelinks": [], "assignee": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "updated": "2016-04-20T07:51:40.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h6.Issue description\r\nThe Titanium Android app below sets the user-agent on a WebView, so the web server can differentiate the Android app from the Android browser. When setUserAgent is used, touching an HTML select will no longer open the input on the bottom of the screen.\r\n\r\nh6.app.js\r\n{code}\r\nvar tabGroup = Ti.UI.createTabGroup({ exitOnClose: true });\r\n var webView = Titanium.UI.createWebView();\r\n webView.setUrl('select.html');\r\n \r\n // removing the setUserAgent fixes the HTML select\r\n webView.setUserAgent('Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; SAMSUNG-SGH-I747 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30');\r\n \r\n var window = Titanium.UI.createWindow();\r\n window.add(webView);\r\n var adviceTab = Ti.UI.createTab({\r\n title : \"Title\",\r\n window : window\r\n });\r\n window.containingTab = adviceTab;\r\n tabGroup.addTab(adviceTab);\r\n tabGroup.open();\r\n{code}\r\n\r\nh6.select.html\r\n{code}\r\n\r\n\r\n\r\nTesting options\r\n\r\n\r\n\r\n\r\n\r\n{code}\r\n\r\nh6.Stack trace\r\n{code}\r\n-- Start application log -----------------------------------------------------\r\n[INFO] : TiApplication: (main) [1,1] checkpoint, app created.\r\n[INFO] : TiApplication: (main) [36,37] Titanium 5.0.2 (2015/09/30 12:07 92c2265)\r\n[INFO] : TiApplication: (main) [18,55] Titanium Javascript runtime: v8\r\n[INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null\r\n[WARN] : V8Object: (KrollRuntimeThread) [387,387] Runtime disposed, cannot set property 'userAgent'\r\n[INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.appc.test.AndroidserviceActivity@208e5400\r\n[DEBUG] : OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true\r\n[DEBUG] : D/ : HostConnection::get() New Host Connection established 0xb3ecede0, tid 7052\r\n[DEBUG] : Atlas: Validating map...\r\n[DEBUG] : libEGL: loaded /system/lib/egl/libEGL_emulation.so\r\n[DEBUG] : libEGL: loaded /system/lib/egl/libGLESv1_CM_emulation.so\r\n[DEBUG] : libEGL: loaded /system/lib/egl/libGLESv2_emulation.so\r\n[DEBUG] : D/ : HostConnection::get() New Host Connection established 0xaec39840, tid 7077\r\n[INFO] : OpenGLRenderer: Initialized EGL, version 1.4\r\n[DEBUG] : OpenGLRenderer: Enabling debug mode 0\r\n[WARN] : EGL_emulation: eglSurfaceAttrib not implemented\r\n[WARN] : OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xaec35c60, error=EGL_SUCCESS\r\n[TRACE] : updating tiapp metadata with Appcelerator Platform...\r\n[DEBUG] : TabGroup: Checkpoint: postTabGroupCreated()\r\n[INFO] : WebViewFactory: Loading com.android.webview version 39 (eng.buildbot-x86) (code 399997)\r\n[INFO] : LibraryLoader: Time to load native libraries: 3 ms (timestamps 1967-1970)\r\n[INFO] : LibraryLoader: Expected native library version number \"\",actual native library version number \"\"\r\n[TRACE] : WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {136e5b52}\r\n[INFO] : LibraryLoader: Expected native library version number \"\",actual native library version number \"\"\r\n[INFO] : chromium: [INFO:library_loader_hooks.cc(104)] Chromium logging enabled: level = 0, default verbosity = 0\r\n[INFO] : BrowserStartupController: Initializing chromium process, singleProcess=true\r\n[WARN] : art: Attempt to remove local handle scope entry from IRT, ignoring\r\n[WARN] : chromium: [WARNING:resource_bundle.cc(304)] locale_file_path.empty()\r\n[INFO] : chromium: [INFO:aw_browser_main_parts.cc(65)] Load from apk succesful, fd=47 off=46184 len=3037\r\n[INFO] : chromium: [INFO:aw_browser_main_parts.cc(78)] Loading webviewchromium.pak from, fd:48 off:229484 len:1089587\r\n[ERROR] : BluetoothAdapter: Bluetooth binder is null\r\n[TRACE] : Uploaded tiapp metadata with Appcelerator Platform!\r\n[WARN] : chromium: [WARNING:mailbox_synchronizer.cc(41)] MailboxSync not supported due to missing EGL image/fence support\r\n[WARN] : chromium: [WARNING:data_reduction_proxy_settings.cc(331)] SPDY proxy OFF at startup\r\n[WARN] : art: Attempt to remove local handle scope entry from IRT, ignoring\r\n[WARN] : AwContents: onDetachedFromWindow called when already detached. Ignoring\r\n[WARN] : art: Attempt to remove local handle scope entry from IRT, ignoring\r\n[WARN] : art: Attempt to remove local handle scope entry from IRT, ignoring\r\n[WARN] : art: Attempt to remove local handle scope entry from IRT, ignoring\r\n[WARN] : art: Attempt to remove local handle scope entry from IRT, ignoring\r\n[WARN] : art: Attempt to remove local handle scope entry from IRT, ignoring\r\n[WARN] : art: Attempt to remove local handle scope entry from IRT, ignoring\r\n[WARN] : EGL_emulation: eglSurfaceAttrib not implemented\r\n[WARN] : OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xaec35c80, error=EGL_SUCCESS\r\n[INFO] : Choreographer: Skipped 47 frames! The application may be doing too much work on its main thread.\r\n[INFO] : Choreographer: Skipped 40 frames! The application may be doing too much work on its main thread.\r\n[ERROR] : chromium: [ERROR:buffer_manager.cc(313)] [.Parent-Compositor-0xaee39a90]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command\r\n[INFO] : Choreographer: Skipped 40 frames! The application may be doing too much work on its main thread.\r\n[INFO] : Choreographer: Skipped 50 frames! The application may be doing too much work on its main thread.\r\n[INFO] : Choreographer: Skipped 53 frames! The application may be doing too much work on its main thread.\r\n[INFO] : Choreographer: Skipped 34 frames! The application may be doing too much work on its main thread.\r\n{code}\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: Ti.UI.WebView.setUserAgent() breaks HTML selection", "creator": { "name": "mspivey", "key": "mspivey", "displayName": "Matthew Spivey", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mspivey", "key": "mspivey", "displayName": "Matthew Spivey", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TitaniumSDK 5.0.2.GA\r\nGoogle Nexus 6 - 5.1.0", "comment": { "comments": [ { "id": "308477", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Moving this to engineering as I can reproduce the issue with the provided test case and the attached html file. I can only see the issue if webView.setUserAgent is used.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-06-11T16:44:22.000+0000", "updated": "2014-06-11T16:44:22.000+0000" }, { "id": "327017", "author": { "name": "estenger", "key": "estenger", "displayName": "Ed Stenger", "active": true, "timeZone": "America/New_York" }, "body": "This issue is still occurring in more recent releases of Titanium SDK\r\nUsing build: 3.4.0.201409261227, SDK 3.3.0.GA and 3.4.0.GA\r\nTested on these devices, but expect it is occurring universally:\r\nSamsung Galaxy S3 running Android 4.3, API 18\r\nSamsung Galaxy S3 and S4 running Android 4.4.2, API 19\r\nMotorola Droid Razr running Android 4.1.1, API 16\r\nOne additional note/observation: The select pop-up dialog does seem to instantiate, but UNDER the main window. If you close the main window, you are able to briefly view the dialog before the window closes completely. There doesn't seem to be any kind of workaround. \r\n", "updateAuthor": { "name": "estenger", "key": "estenger", "displayName": "Ed Stenger", "active": true, "timeZone": "America/New_York" }, "created": "2014-10-06T14:34:56.000+0000", "updated": "2014-10-06T14:34:56.000+0000" }, { "id": "335037", "author": { "name": "rlinasi", "key": "rlinasi", "displayName": "Ronald Linasi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have the same problem with select on remote sites on android. Without setting the userAgent the select works as aspected.", "updateAuthor": { "name": "rlinasi", "key": "rlinasi", "displayName": "Ronald Linasi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-12-05T13:36:12.000+0000", "updated": "2014-12-05T13:36:12.000+0000" }, { "id": "354068", "author": { "name": "milgner", "key": "milgner", "displayName": "Marcus Ilgner", "active": true, "timeZone": "Europe/Berlin" }, "body": "I just have reproduced this with a current 4.0 build. After using {{setUserAgent}}, the web view behaves as follows:\r\n\r\n* the touch keyboard does not open anymore when focussing a text field. Using {{Titanium.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS}} allows entering text but provides bad UX since the keyboard does not close when no field has focus.\r\n* {{select}} boxes don't work at all. When closing the web view while the box has focus, the selection control can be seen for a very short time before being destroyed: it looks like it is instantiated *behind* the web view and thus not visible.\r\n\r\nIn my opinion this is a grave bug that breaks an important UI component.", "updateAuthor": { "name": "milgner", "key": "milgner", "displayName": "Marcus Ilgner", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-06-02T08:23:05.000+0000", "updated": "2015-06-02T08:23:05.000+0000" }, { "id": "370667", "author": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "body": "A quick workaround is to create and add the web view in 'open' event of the window or tabgroup. This is to make sure that the web view is created in the context of the main window. \r\n{code}\r\n var tabGroup = Ti.UI.createTabGroup({ exitOnClose: true });\r\n var window = Titanium.UI.createWindow();\r\n var adviceTab = Ti.UI.createTab({\r\n title : \"Title\",\r\n window : window\r\n });\r\n window.containingTab = adviceTab;\r\n tabGroup.addTab(adviceTab);\r\n tabGroup.open();\r\n \r\n window.addEventListener('open', function() {\r\n\t var webView = Titanium.UI.createWebView();\r\n\t webView.setUrl('select.html');\r\n\t \twebView.setUserAgent(\"Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; SAMSUNG-SGH-I747 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30\");\r\n\t \twindow.add(webView);\r\n });\r\n{code}", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-11-18T08:08:38.000+0000", "updated": "2015-11-18T08:09:09.000+0000" }, { "id": "372009", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Please use the workaround and comment if there are still issues.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-12-03T03:36:12.000+0000", "updated": "2015-12-03T03:36:12.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }