{ "id": "82351", "key": "TIMOB-6000", "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": "2011-11-04T19:45:12.000+0000", "created": "2011-11-04T14:19:17.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "cursor", "position", "textfield" ], "versions": [ { "id": "12570", "name": "Release 1.7.5", "archived": true, "released": true, "releaseDate": "2011-11-02" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "issuelinks": [ { "id": "13770", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "82363", "key": "TIMOB-6006", "fields": { "summary": "Android: Expose methods for controlling selection and cursor in TextField and TextArea", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-11-04T19:45:12.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": "h3.Problem\r\nReplacing the textfield value makes the cursor go back before the first character. Works correctly on iOS.\r\n\r\nh3.Reproducible Steps\r\n1. Run the Sample Code\r\n2. Put one character into the textfield\r\n\r\nh3.Sample Code\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\n\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\n\r\n\r\nvar label1 = Titanium.UI.createLabel({\r\n\tcolor:'#999',\r\n\ttext:'I am Window 1',\r\n\tfont:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n\ttextAlign:'center',\r\n\twidth:'auto'\r\n});\r\n\r\nvar textfield = Titanium.UI.createTextField({\r\n color:'#336699',\r\n value:'',\r\n height:35,\r\n width:300,\r\n top:10,\r\n borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,\r\n keyboardToolbarColor: '#999', \r\n keyboardToolbarHeight: 40,\r\n autocapitalization: Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,\r\n autocorrection: false\r\n \r\n});\r\n\r\nwin1.add(textfield);\r\ntextfield.addEventListener(\"change\",function(e){\r\n\tif(textfield.value.length>0) textfield.value = \"test\";\r\n});\r\n\r\nwin1.open();\r\n\r\n{code}\r\n\r\nh3.Associated HelpDesk Ticket\r\nhttp://appc.me/c/APP-436254", "attachment": [], "flagged": false, "summary": "Android: replacing the textfield value makes the cursor go back to the start", "creator": { "name": "kpomaski", "key": "kpomaski", "displayName": "Karol Pomaski", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "kpomaski", "key": "kpomaski", "displayName": "Karol Pomaski", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Simulator, Android 2.3.3, SDK 1.7.5, SDK 1.8.0.v20111027152620", "comment": { "comments": [ { "id": "171585", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The required solution is much bigger than expressed in this ticket and its test case. TIMOB-6006 was created to expose the appropriate APIs to allow this to be solved by the application developer.", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-04T19:45:12.000+0000", "updated": "2011-11-04T19:45:12.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }