{ "id": "129687", "key": "TIMOB-16905", "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": null, "resolutiondate": null, "created": "2014-04-25T17:56:33.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "focus", "picker", "scrollview", "switch", "textfield" ], "versions": [ { "id": "15857", "description": "Release 3.2.2", "name": "Release 3.2.2", "archived": false, "released": true, "releaseDate": "2014-03-09" } ], "issuelinks": [], "assignee": { "name": "mchen", "key": "mchen", "displayName": "Maggie Chen", "active": true, "timeZone": "Asia/Singapore" }, "updated": "2017-09-11T13:08:29.000+0000", "status": { "description": "This issue is being actively worked on at the moment by the assignee.", "name": "In Progress", "id": "3", "statusCategory": { "id": 4, "key": "indeterminate", "colorName": "yellow", "name": "In Progress" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "See code example below. Clicking on the switch, or making a picker selection causes the ScrollView to scroll back to the TextField, with apparently no way to prevent this behavior.\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\twindowSoftInputMode: Ti.UI.Android.SOFT_INPUT_STATE_ALWAYS_HIDDEN,\r\n\tbackgroundColor: 'black'});\r\nvar scrollview = Ti.UI.createScrollView({\r\n\ttop:'0dp',\r\n\tscrollType: 'vertical',\r\n\twidth: Ti.UI.FILL,\r\n\tcontentHeight: 'auto',\r\n\tcontentWidth: 'auto',\r\n\tlayout: 'vertical',\r\n\tshowVerticalScrollIndicator: true,\r\n\tscrollingEnabled: true});\r\n\r\n\r\nvar textfield = Ti.UI.createTextField({top: 10, right: 10, left: 10});\r\nscrollview.add(textfield);\r\n\r\nvar Switch = Ti.UI.createSwitch({\r\n\ttop: '2000dp'\r\n});\r\nscrollview.add(Switch);\r\n\r\nvar picker = Ti.UI.createPicker({\r\n top:'20dp'\r\n});\r\n\r\nvar data = [];\r\ndata[0]=Ti.UI.createPickerRow({title:'Bananas'});\r\ndata[1]=Ti.UI.createPickerRow({title:'Strawberries'});\r\ndata[2]=Ti.UI.createPickerRow({title:'Mangos'});\r\ndata[3]=Ti.UI.createPickerRow({title:'Grapes'});\r\n\r\npicker.add(data);\r\npicker.selectionIndicator = true;\r\nscrollview.add(picker);\r\n\r\nwin.add(scrollview);\t\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: ScrollView automatically scrolls to TextField after click on switch or picker selection", "creator": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "subtasks": [], "reporter": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "environment": "SDK 3.3.0, 3.2.2.GA, tested on Nexus S Android 2.3.6 and 4.1.2", "comment": { "comments": [ { "id": "303011", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I reduced top to 100dp for Switch to force all three controls to be on the same screen. I noticed that TextField is always focused even when you click on Switch or Picker. It gives the impression of auto scrolling when these controls are not on the same screen. Is this the behavior you are seeing as well?", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-30T05:53:00.000+0000", "updated": "2014-04-30T05:53:00.000+0000" }, { "id": "303055", "author": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "Yup. I don't think users mind if the cursor stays in the TextField. The issue is however that the screen jumps back to the TextField as soon as the switch or picker are clicked, which is a real problem.", "updateAuthor": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2014-04-30T15:36:14.000+0000", "updated": "2014-04-30T15:36:14.000+0000" }, { "id": "303286", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Moving this ticket to engineering as I can reproduce this issue with the provided test case.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-02T05:43:42.000+0000", "updated": "2014-05-02T05:43:42.000+0000" }, { "id": "303290", "author": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "BTW - the issue does not occur on Button elements. I have seen it on Switch and Picker, perhaps it occurs on other elements too.", "updateAuthor": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2014-05-02T07:46:40.000+0000", "updated": "2014-05-02T07:46:40.000+0000" }, { "id": "317710", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue reproduces \r\n\r\nTitanium Studio, build: 3.3.0.201407100905\r\nTitanium SDK version 3.3.0.GA \r\nCLI version 3.3.0, \r\ndevice: HTC Desire X (HT35XLY01791)\r\nTargeting Android SDK: 20", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-08T13:20:34.000+0000", "updated": "2014-08-08T13:20:34.000+0000" }, { "id": "336956", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "I tried this with a native android implementation and the behavior is similar.\r\n\r\nThe textfield is focused and after pressing the switch, it will go to the textfield (or edittext) by scrolling to it.\r\n\r\nI tested it with a scenario as follows in a native app:\r\nEditText at the top.\r\nSwitch in the middle.\r\nEditText at the bottom.\r\n\r\nCase 1: Touch EditText at the bottom. Scroll to the middle to toggle the Switch. The screen will automatically scroll to the bottom to focus on the EditText at the bottom.\r\n\r\nCase 2: Touch EditText at the top. Scroll to the middle to toggle the Switch. The screen will automatically scroll to the top to focus on the EditText at the top.\r\n", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2014-12-18T02:17:31.000+0000", "updated": "2014-12-18T02:17:50.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }