{ "id": "174830", "key": "AC-6509", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": null, "resolutiondate": null, "created": "2020-03-19T14:27:45.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-03-30T08:56:36.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "We have a screen where on \"return\" event of a text field, we are calling the focus event of picker. But it doesn't pop-up the picker.\r\n\r\nTo reproduce this issue, download the code from below shared link.\r\nhttps://drive.google.com/open?id=1o3XYemcFsvxauHYWc8x0MI1aj7D484SS\r\nLaunch the app on Android, type something in the LastName text field, and then press enter/next on the keyboard. It should focus on the picker, but instead it's focusing on the last text field.\r\n\r\nCan you please look into this issue and patch the fix to 8.3.0/8.3.1 ?\r\n\r\nThanks", "attachment": [], "flagged": false, "summary": "Picker's focus event not working on Android", "creator": { "name": "nvishnoi", "key": "nvishnoi", "displayName": "Naman Vishoi", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "nvishnoi", "key": "nvishnoi", "displayName": "Naman Vishoi", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Tested on both SDK 9.0.0.GA and 8.3.0.GA", "comment": { "comments": [ { "id": "454803", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi, could you please attach a compact standalone app, single file, titanium classic: index.js basically.", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-03-23T10:49:05.000+0000", "updated": "2020-03-23T10:49:05.000+0000" }, { "id": "454896", "author": { "name": "nvishnoi", "key": "nvishnoi", "displayName": "Naman Vishoi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{code:js}\r\nvar lastNameTxtField;\r\nvar picker;\r\n\r\n var win = Ti.UI.createWindow({\r\n title: 'picker',\r\n backgroundColor: '#fff'\r\n });\r\n\r\n var createAccountContainer = Ti.UI.createView({\r\n top: '8dp',\r\n left: '20dp',\r\n right: '20dp',\r\n height: Titanium.UI.SIZE,\r\n width: Titanium.UI.FILL,\r\n backgroundColor: 'white',\r\n bottom: '8dp',\r\n layout: 'vertical'\r\n });\r\n\r\n var firstNameLbl = Ti.UI.createLabel({\r\n text: \"First name\",\r\n height: Titanium.UI.SIZE,\r\n width: Titanium.UI.FILL,\r\n top: '8dp',\r\n bottom: '0dp',\r\n left: '16dp',\r\n right: '16dp',\r\n font: {\r\n fontSize: '16sp'\r\n },\r\n textAlign: Titanium.UI.TEXT_ALIGNMENT_LEFT,\r\n color: '#3D5791'\r\n });\r\n\r\n var firstNameTxtField = Ti.UI.createTextField({\r\n top: '10dp',\r\n height: '40',\r\n borderColor: 'gray',\r\n hintText: 'First name',\r\n returnKeyType: \"Titanium.UI.RETURNKEY_NEXT\",\r\n width: Ti.UI.FILL,\r\n bottom: '4dp',\r\n left: '16dp',\r\n right: '16dp',\r\n font: {\r\n fontSize: '16sp'\r\n },\r\n color: '#4d4d4d',\r\n verticalAlign: Titanium.UI.TEXT_VERTICAL_ALIGNMENT_CENTER\r\n });\r\n\r\n var lastNameLbl = Ti.UI.createLabel({\r\n text: \"Last name\",\r\n height: Titanium.UI.SIZE,\r\n width: Titanium.UI.FILL,\r\n top: '8dp',\r\n bottom: '0dp',\r\n left: '16dp',\r\n right: '16dp',\r\n font: {\r\n fontSize: '16sp'\r\n },\r\n textAlign: Titanium.UI.TEXT_ALIGNMENT_LEFT,\r\n color: '#3D5791'\r\n });\r\n\r\n lastNameTxtField = Ti.UI.createTextField({\r\n top: '10dp',\r\n height: '40',\r\n borderColor: 'gray',\r\n hintText: 'Last name',\r\n returnKeyType: \"Titanium.UI.RETURNKEY_NEXT\",\r\n width: Ti.UI.FILL,\r\n bottom: '4dp',\r\n left: '16dp',\r\n right: '16dp',\r\n font: {\r\n fontSize: '16sp'\r\n },\r\n color: '#4d4d4d',\r\n verticalAlign: Titanium.UI.TEXT_VERTICAL_ALIGNMENT_CENTER\r\n });\r\n\r\n var caseIdtypeLbl = Ti.UI.createLabel({\r\n text: \"Case Id\",\r\n height: Titanium.UI.SIZE,\r\n width: Titanium.UI.FILL,\r\n top: '8dp',\r\n bottom: '0dp',\r\n left: '16dp',\r\n right: '16dp',\r\n font: {\r\n fontSize: '16sp'\r\n },\r\n textAlign: Titanium.UI.TEXT_ALIGNMENT_LEFT,\r\n color: '#3D5791'\r\n });\r\n\r\n var pickerContainer = Ti.UI.createView({\r\n height: Ti.UI.SIZE\r\n });\r\n\r\n picker = Titanium.UI.createPicker({\r\n height: '50dp',\r\n top: '10dp',\r\n left: '16dp',\r\n color: 'black',\r\n backgroundColor: 'grey',\r\n width: '100%'\r\n });\r\n\r\n var selectedValueLbl = Ti.UI.createLabel({\r\n text: \"How would you like to identify yourself?\",\r\n height: Titanium.UI.SIZE,\r\n width: Titanium.UI.FILL,\r\n top: '8dp',\r\n bottom: '0dp',\r\n left: '16dp',\r\n right: '16dp',\r\n font: {\r\n fontSize: '16sp'\r\n },\r\n textAlign: Titanium.UI.TEXT_ALIGNMENT_LEFT,\r\n color: '#3D5791'\r\n });\r\n\r\n var selectedValue = Ti.UI.createTextField({\r\n top: '10dp',\r\n height: '40',\r\n borderColor: 'gray',\r\n hintText: 'Identify',\r\n returnKeyType: \"Titanium.UI.RETURNKEY_DONE\",\r\n width: Ti.UI.FILL,\r\n bottom: '4dp',\r\n left: '16dp',\r\n right: '16dp',\r\n font: {\r\n fontSize: '16sp'\r\n },\r\n color: '#4d4d4d',\r\n verticalAlign: Titanium.UI.TEXT_VERTICAL_ALIGNMENT_CENTER\r\n });\r\n\r\n win.add(createAccountContainer);\r\n createAccountContainer.add(firstNameLbl);\r\n createAccountContainer.add(firstNameTxtField);\r\n createAccountContainer.add(lastNameLbl);\r\n createAccountContainer.add(lastNameTxtField);\r\n createAccountContainer.add(caseIdtypeLbl);\r\n\r\n pickerContainer.add(picker);\r\n createAccountContainer.add(pickerContainer);\r\n\r\n createAccountContainer.add(selectedValueLbl);\r\n createAccountContainer.add(selectedValue);\r\n\r\n var pickerValues = ['Case Num', 'SSN Num'];\r\n var data = [];\r\n\r\n for (var i = 0; i < pickerValues.length; i++) {\r\n data[i] = Ti.UI.createPickerRow({\r\n title: pickerValues[i]\r\n });\r\n }\r\n picker.add(data);\r\n picker.selectionIndicator = true;\r\n\r\n picker.setSelectedRow(0, 0);\r\n\r\n\r\nfunction focusOnPicker(e) {\r\n picker.focus();\r\n}\r\n\r\nlastNameTxtField.addEventListener('return', focusOnPicker);\r\n\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-03-27T19:18:49.000+0000", "updated": "2020-03-30T08:38:24.000+0000" }, { "id": "454897", "author": { "name": "nvishnoi", "key": "nvishnoi", "displayName": "Naman Vishoi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have uploaded the whole titanium classic app at\r\nhttps://drive.google.com/file/d/1I0Kidowi5gl-GV28b2FyqVVyTl8h38er/view?usp=sharing\r\n\r\nAlso pasted the single file content in the comment above\r\n", "updateAuthor": { "name": "nvishnoi", "key": "nvishnoi", "displayName": "Naman Vishoi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-03-27T19:24:07.000+0000", "updated": "2020-03-27T19:24:07.000+0000" }, { "id": "454902", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi,\r\n\r\nIf you check the documentation you can see the focus event doesn't exist in a picker, however, when you change the row in the callback function to this:\r\n\r\n{code:js}\r\npicker.setSelectedRow(0,picker.selectedValue);\r\n{code}\r\nAnd you add this property to the picker:\r\n{code:js}\r\nselectionOpens: true\r\n{code}\r\n\r\nYou should see the picker open when you click the return key while focussed on the lastname field.\r\n\r\nlet me know if this solves it for you, then we can close the ticket.", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-03-30T08:56:36.000+0000", "updated": "2020-03-30T08:56:36.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }