{ "id": "91226", "key": "TIMOB-8957", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-05-03T18:23:50.000+0000", "created": "2012-05-02T16:23:38.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "issuelinks": [], "assignee": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-13T18:33:08.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": "h2. Problem\r\nWhen the user try to use the hardware keyboard, anytime that the user stroke a key, the textfield get's blurred, \r\n\r\nh2. Expected behavior\r\nUse the hardware keyboard to introduce text into the text field with no problems\r\n\r\nh2. Notes\r\nI'm using a eventlistener to catch anytime the textfield change, if I put a scrollView.scrollToBottom inside the event Listener, the blur event of the textField gets fired, if I comment the scrollToBottom, then, the user can use the hardware keyboard with no problems\r\n\r\nh2. Test case\r\n{code:title=app.js|borderStyle=solid}\r\nvar win = Titanium.UI.createWindow({ backgroundColor:'blue', modal:true, navBarHidden:true});\r\n\r\n\tvar textField = Ti.UI.createTextArea({\r\n\t\t\theight:60,//hiddenLabel.height,\r\n\t\t\tleft:10,\r\n\t\t\tright:10,\r\n\t\t\tautocapitalization:Ti.UI.TEXT_AUTOCAPITALIZATION_SENTENCES,\r\n\t\t\ttop:5,\r\n\t\t\tisFocused: false\r\n\t\t});\r\n\t\tvar scrollView;\r\n\t\tscrollView = Ti.UI.createScrollView({\r\n\t\t\tleft:0,\r\n\t\t\ttop:0,\r\n\t\t\tright:0,\r\n\t\t\tcontentHeight:'auto',\r\n\t\t\tbackgroundColor: 'green'\r\n\t\t});\r\n\r\n\t\t\r\n\t\ttextField.addEventListener('focus', function(e)\r\n\t\t{\r\n\t\t\tTi.API.info('textField has been focused.');\r\n\t\t\ttextField.isFocused = true;\r\n\t\t});\r\n\t\ttextField.addEventListener('blur', function(e)\r\n\t\t{\r\n\t\t\tTi.API.info('textField has been blurred.');\r\n\t\t\ttextField.isFocused = false;\r\n\t\t});\r\n\t\t\r\n\t\ttextField.addEventListener('change', function(e)\r\n\t\t{\r\n\t\t\tTi.API.error('****************************** scrollview to bottom');\r\n\t\t\tscrollView.scrollToBottom();\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\nwin.add(scrollView);\t\t\r\nwin.add(textField);\r\nwin.open();\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: hardware keyboard issue with scrollview and testField ", "creator": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "subtasks": [], "reporter": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "environment": "Titanium Studio, build: 2.0.1.201204132053\r\nMac OSX: 10.7.2\r\nAndroid Handheld device: 2.3.4 Droid 3 with hardware keyboard\r\nTitanium SDK: 2.1.0", "comment": { "comments": [ { "id": "193674", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This seems to be native behavior in android.\r\n\r\n{code}\r\n\tprivate ScrollView sview;\r\n\t\r\n /** Called when the activity is first created. */\r\n @Override\r\n public void onCreate(Bundle savedInstanceState) {\r\n \tsuper.onCreate(savedInstanceState);\r\n \tRelativeLayout parent = new RelativeLayout(this);\r\n \tsview = new ScrollView(this);\r\n \tMyEditText text = new MyEditText(this);\r\n \ttext.setMinimumWidth(200);\r\n\t\tparent.addView(sview);\r\n\t\tparent.addView(text);\r\n \tsetContentView(parent);\r\n }\r\n \r\n private class MyEditText extends EditText {\r\n\r\n\tpublic MyEditText(Context context)\r\n\t{\r\n\t\tsuper(context);\r\n\t}\r\n\r\n\t@Override\r\n\tprotected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter)\r\n\t{\r\n\t\tsuper.onTextChanged(text, start, lengthBefore, lengthAfter);\r\n\t\tsview.fullScroll(View.FOCUS_DOWN);\r\n\t}\r\n{code}\r\n\r\nIt looks like there is a focus() method on text area, so you may be able to force the textarea to gain focus after it has scrolled to the bottom.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-03T18:23:37.000+0000", "updated": "2012-05-03T18:23:37.000+0000" }, { "id": "411486", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-13T18:33:08.000+0000", "updated": "2017-03-13T18:33:08.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }