{ "id": "104220", "key": "TIMOB-11627", "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": [ { "id": "14621", "description": "2012 Sprint 23 API", "name": "2012 Sprint 23 API", "archived": true, "released": true, "releaseDate": "2012-11-19" }, { "id": "14623", "description": "2012 Sprint 23 JS", "name": "2012 Sprint 23", "archived": true, "released": true, "releaseDate": "2012-11-19" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-11-02T22:19:21.000+0000", "created": "2012-10-31T22:04:04.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api" ], "versions": [ { "id": "14137", "description": "Release 2.1.3", "name": "Release 2.1.3", "archived": true, "released": true, "releaseDate": "2012-10-03" } ], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:44:09.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": "searchBar.focus() doesn't open the softKeyboard. In the code below if you uncomment the code that adds a tableView the keyboard opens properly. This problem seems to happen with textField as well.\r\nh4. Repo Steps\r\n1. Run the below code in your project's app.js.\r\n2. Open the application.\r\n3. The cursor shows up in the search bar but the keyboard never opens.\r\n\r\n{code}\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar win = Titanium.UI.createWindow({\r\n\tbackgroundColor : '#fff'\r\n});\r\nvar dirView = Ti.UI.createView({\r\n\tlayout : 'vertical',\r\n\theight : Ti.UI.FILL\r\n});\r\n\r\nvar searchBar = Titanium.UI.createSearchBar({//problem also exists with TextField\r\n\twidth : Ti.UI.FILL,\r\n\theight : 50,\r\n\tsoftKeyboardOnFocus : Ti.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS\r\n});\r\n\r\ndirView.add(searchBar);\r\n\r\n//the cursor shows up in the search bar but the keyboard never opens\r\nsearchBar.focus();\r\n\r\n//uncommenting these lines 'fixes' the problem\r\n\r\n// var thelist = Titanium.UI.createTableView();\r\n// dirView.add(thelist);\r\n\r\nwin.add(dirView);\r\nwin.open(); \r\n{code}", "attachment": [], "flagged": false, "summary": "Android: searchBar.focus() doesn't open the softKeyboard", "creator": { "name": "nsharma", "key": "nsharma", "displayName": "Nikhil Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "nsharma", "key": "nsharma", "displayName": "Nikhil Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Samsung Galaxy SII\r\nandroid 2.3.4\r\nTi SDK 2.1.3", "comment": { "comments": [ { "id": "226124", "author": { "name": "bzeghers", "key": "bzeghers", "displayName": "Ben Zeghers", "active": true, "timeZone": "America/Chicago" }, "body": "The code that you posted to fix this issue doesn't work. I put it into the above app.js and the keyboard still doesn't open when I open the app.", "updateAuthor": { "name": "bzeghers", "key": "bzeghers", "displayName": "Ben Zeghers", "active": true, "timeZone": "America/Chicago" }, "created": "2012-11-05T15:02:08.000+0000", "updated": "2012-11-05T15:02:08.000+0000" }, { "id": "226165", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Which build did you test this on? It works fine for me for 2.x, 3.x, and 4.x phones on master. This is the app.js I use: \n{code}\nTitanium.UI.setBackgroundColor('#000');\n \nvar win = Titanium.UI.createWindow({\n backgroundColor : '#fff'\n});\nvar dirView = Ti.UI.createView({\n layout : 'vertical',\n height : Ti.UI.FILL\n});\n \nvar searchBar = Titanium.UI.createTextField({//problem also exists with TextField\n width : Ti.UI.FILL,\n height : 50,\n softKeyboardOnFocus : Ti.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS\n});\n \ndirView.add(searchBar);\n \n//the cursor shows up in the search bar but the keyboard never opens\n//searchBar.focus();\n \n//uncommenting these lines 'fixes' the problem\n \n// var thelist = Titanium.UI.createTableView();\n// dirView.add(thelist);\n\nvar fireFocus = false;\nwin.addEventListener('postlayout', function() {\nif (!fireFocus) {\n\tsearchBar.focus();\n\tfireFocus = true;\n}\n\n});\nwin.add(dirView);\nwin.open(); \n\n\n{code}", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-05T19:02:07.000+0000", "updated": "2012-11-05T19:02:07.000+0000" }, { "id": "226302", "author": { "name": "bzeghers", "key": "bzeghers", "displayName": "Ben Zeghers", "active": true, "timeZone": "America/Chicago" }, "body": "I tested this on master and it seems to be fixed. Thanks", "updateAuthor": { "name": "bzeghers", "key": "bzeghers", "displayName": "Ben Zeghers", "active": true, "timeZone": "America/Chicago" }, "created": "2012-11-06T14:47:19.000+0000", "updated": "2012-11-06T14:47:19.000+0000" }, { "id": "250973", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with: \r\nSDK:3.1.1.v20130508233955\r\nAppcelerator Studio: 3.1.1.201305072102\r\nOS: OSX 10.7.5\r\nDevice: LG-p970(2.2.2), Android emulator(2.3.3)\r\n\r\nworks as expected", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-09T10:15:48.000+0000", "updated": "2013-05-09T10:15:48.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }