{ "id": "98549", "key": "TIMOB-10295", "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": "14065", "description": "Sprint 2012-17 API", "name": "Sprint 2012-17 API", "archived": true, "released": true, "releaseDate": "2012-08-27" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-09-05T02:26:03.000+0000", "created": "2012-08-01T16:04:50.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api", "module_scrollview", "qe-review", "qe-testadded" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [], "assignee": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-09-05T02:26:03.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "This is for an app in which controls may dynamically be disabled and enabled. When disabled a TextArea and enabled it, the ScrollView is automatically getting scrolled to the newly enabled TextArea which is not desirable. There is a textField in this app as well, but it does not have this behavior. \r\n\r\nh4.Sample Code\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: 'white'\r\n\t});\r\n\twin.open();\r\n\t//var self = Ti.UI.createView();\r\n\t//win.add(self);\r\n\tvar scrollView = Ti.UI.createScrollView( { width: 400,\r\n\t\t\t\t\t\t\t\t\t\t\t\theight: 600, \r\n\t\t\t\t\t\t\t\t\t\t\t\t contentWidth: \"auto\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t contentHeight: \"auto\", \r\n\t\t\t\t\t\t\t\t\t\t\t\t showVerticalScrollIndicator: true });\r\n\t\t\t\t\t\t\t\t\t\t\t\t \r\n var scrollingView\t= Ti.UI.createView({ top: 0, width: 390, height: 1000, backgroundColor: '#efefef' });\r\n\r\n\tvar label = Ti.UI.createLabel({\r\n\t\tcolor:'#000000',\r\n\t\ttext: 'Click to enable TextField (does not scroll)',\r\n\t\tleft: 25,\r\n\t\ttop: 20,\r\n\t\theight:'auto',\r\n\t\twidth:'auto'\r\n\t});\r\n\tvar actionButton = Ti.UI.createButton ( { backgroundImage: \"/Images/actionButton.png\", \r\n\t\t\t\t\t\t\t\t\t\t\t left: 100,\r\n\t\t\t\t\t\t\t\t\t\t\t top: 50,\r\n\t\t height: 45, \r\n\t\t width: 45,\r\n\t\t } ); \r\n\r\n\tvar label2 = Ti.UI.createLabel({\r\n\t\tcolor:'#000000',\r\n\t\ttext: 'Click to enable TextArea (scrolls)',\r\n\t\tleft: 25,\r\n\t\ttop: 120,\r\n\t\theight:'auto',\r\n\t\twidth:'auto'\r\n\t});\r\n\tvar actionButton2 = Ti.UI.createButton ( { backgroundImage: \"/Images/actionButton.png\", \r\n\t\t\t\t\t\t\t\t\t\t\t left: 100,\r\n\t\t\t\t\t\t\t\t\t\t\t top: 150,\r\n\t\t height: 45, \r\n\t\t width: 45,\r\n\t\t } ); \r\n\t\t \r\n\twin.add(label);\t \r\n\twin.add(actionButton); \r\n\twin.add(label2);\t \r\n\twin.add(actionButton2); \r\n\r\n\twin.add(scrollView);\r\n\tscrollView.add(scrollingView);\r\n\t\r\n\t//label using localization-ready strings from /i18n/en/strings.xml\r\n\tvar textField1 = Ti.UI.createTextField( { left: 40,\r\n\t\t\t\t\t\t\t\t\t\t\t top: 50,\r\n\t\t\t\t\t\t\t\t\t\t\t width: 100,\r\n\t\t\t\t\t\t\t\t\t\t\t height: 20,\r\n\t\t\t\t\t\t\t\t\t\t\t keyboardType: Titanium.UI.KEYBOARD_DEFAULT,\r\n\t\t\t\t\t\t\t\t\t\t\t value: \"\",\r\n\t\t\t\t\t\t\t\t\t\t\t borderStyle: Titanium.UI.INPUT_BORDERSTYLE_LINE, \r\n\t\t\t\t\t\t\t\t\t\t\t color: '#000',\r\n\t\t\t\t\t\t\t\t\t\t\t enabled: false\r\n\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\r\n\tvar textField2 = Ti.UI.createTextField( { left: 40,\r\n\t\t\t\t\t\t\t\t\t\t\t top: 350,\r\n\t\t\t\t\t\t\t\t\t\t\t width: 100,\r\n\t\t\t\t\t\t\t\t\t\t\t height: 20,\r\n\t\t\t\t\t\t\t\t\t\t\t keyboardType: Titanium.UI.KEYBOARD_DEFAULT,\r\n\t\t\t\t\t\t\t\t\t\t\t value: \"\",\r\n\t\t\t\t\t\t\t\t\t\t\t borderStyle: Titanium.UI.INPUT_BORDERSTYLE_LINE, \r\n\t\t\t\t\t\t\t\t\t\t\t color: '#000',\r\n\t\t\t\t\t\t\t\t\t\t\t enabled: false\r\n\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\r\n\tvar textField3 = Ti.UI.createTextField( { left: 40,\r\n\t\t\t\t\t\t\t\t\t\t\t top: 550,\r\n\t\t\t\t\t\t\t\t\t\t\t width: 100,\r\n\t\t\t\t\t\t\t\t\t\t\t height: 20,\r\n\t\t\t\t\t\t\t\t\t\t\t keyboardType: Titanium.UI.KEYBOARD_DEFAULT,\r\n\t\t\t\t\t\t\t\t\t\t\t value: \"\",\r\n\t\t\t\t\t\t\t\t\t\t\t borderStyle: Titanium.UI.INPUT_BORDERSTYLE_LINE, \r\n\t\t\t\t\t\t\t\t\t\t\t color: '#000',\r\n\t\t\t\t\t\t\t\t\t\t\t enabled: false\r\n\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\tvar textField4 = Ti.UI.createTextField( { left: 40,\r\n\t\t\t\t\t\t\t\t\t\t\t top: 750,\r\n\t\t\t\t\t\t\t\t\t\t\t width: 100,\r\n\t\t\t\t\t\t\t\t\t\t\t height: 20,\r\n\t\t\t\t\t\t\t\t\t\t\t keyboardType: Titanium.UI.KEYBOARD_DEFAULT,\r\n\t\t\t\t\t\t\t\t\t\t\t value: \"\",\r\n\t\t\t\t\t\t\t\t\t\t\t borderStyle: Titanium.UI.INPUT_BORDERSTYLE_LINE, \r\n\t\t\t\t\t\t\t\t\t\t\t color: '#000',\r\n\t\t\t\t\t\t\t\t\t\t\t enabled: false\r\n\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\tvar textField5 = Ti.UI.createTextField( { left: 40,\r\n\t\t\t\t\t\t\t\t\t\t\t top: 900,\r\n\t\t\t\t\t\t\t\t\t\t\t width: 100,\r\n\t\t\t\t\t\t\t\t\t\t\t height: 20,\r\n\t\t\t\t\t\t\t\t\t\t\t keyboardType: Titanium.UI.KEYBOARD_DEFAULT,\r\n\t\t\t\t\t\t\t\t\t\t\t value: \"\",\r\n\t\t\t\t\t\t\t\t\t\t\t borderStyle: Titanium.UI.INPUT_BORDERSTYLE_LINE, \r\n\t\t\t\t\t\t\t\t\t\t\t color: '#000',\r\n\t\t\t\t\t\t\t\t\t\t\t enabled: false\r\n\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\tvar textArea1 = Ti.UI.createTextArea( { left: 40,\r\n\t\t\t\t\t\t\t\t\t\t\t top: 950,\r\n\t\t\t\t\t\t\t\t\t\t\t width: 100,\r\n\t\t\t\t\t\t\t\t\t\t\t height: 35,\r\n\t\t\t\t\t\t\t\t\t\t\t keyboardType: Titanium.UI.KEYBOARD_DEFAULT,\r\n\t\t\t\t\t\t\t\t\t\t\t value: \"\",\r\n\t\t\t\t\t\t\t\t\t\t\t borderStyle: Titanium.UI.INPUT_BORDERSTYLE_LINE, \r\n\t\t\t\t\t\t\t\t\t\t\t color: '#000',\r\n\t\t\t\t\t\t\t\t\t\t\t enabled: false\r\n\t\t\t\t\t\t\t\t\t\t\t });\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\tscrollingView.add(textField1);\r\n\tscrollingView.add(textField2);\r\n\tscrollingView.add(textField3);\r\n\tscrollingView.add(textField4);\r\n\tscrollingView.add(textField5);\r\n\tscrollingView.add(textArea1);\r\n\t\r\n\r\n\t//Add behavior for UI\r\n\tactionButton.addEventListener('click', function(e) {\r\n\t\ttextField5.enabled = true;\r\n\t});\r\n\r\n\tactionButton2.addEventListener('click', function(e) {\r\n\t\t// scrollView.scrollTo(0,0);\r\n\t\ttextArea1.enabled = true;\r\n\t\t// focusable:'false';\r\n\t\t\r\n\t});\r\n\t\t\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Enabling a TextArea in a ScrollView automatically scrolls to TextArea.", "creator": { "name": "aakkinepally", "key": "aakkinepally", "displayName": "Amuktha Akkinepally", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aakkinepally", "key": "aakkinepally", "displayName": "Amuktha Akkinepally", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK: Mobile 2.1\r\nPlatform OS: iOS\r\nPlatform OS Version: 5.0", "comment": { "comments": [ { "id": "215746", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This seems like a Apple Bug - which is caused if you try setting the editable property on textArea with empty string.\r\n\r\nPR pending [PR 2809|https://github.com/appcelerator/titanium_mobile/pull/2809]", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-22T19:24:19.000+0000", "updated": "2012-08-22T19:24:19.000+0000" }, { "id": "216392", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Enabling textarea do not automatically scrolls to textarea now.\r\nEnvironment used for verification -\r\nTested with Titanium SDK: 2.2.0.v20120827143312\r\nTested with Titanium  Studio: 2.1.2.201208201549\r\nDevice - iOS 5.1 simulator\r\nMachine OS - MAC 10.7.3", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-27T23:56:35.000+0000", "updated": "2012-08-27T23:56:35.000+0000" }, { "id": "217569", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening to update labels", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-05T02:25:20.000+0000", "updated": "2012-09-05T02:25:20.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }