{ "id": "90665", "key": "TIMOB-8846", "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-04-25T16:28:29.000+0000", "created": "2012-04-20T11:45:29.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api", "parity" ], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "issuelinks": [], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-24T18:12:15.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": "*Code*\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: 'white'\r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n\ttitle: 'Press me!',\r\n\twidth: 300,\r\n\theight: 40\r\n});\r\n\r\nbutton.addEventListener('click', function(e)\r\n{\r\n\tvar win2 = Ti.UI.createWindow({\r\n\t\tbackgroundColor: 'yellow',\r\n\t\tfullscreen: false\r\n\t});\r\n\t\r\n\tvar textArea = Ti.UI.createTextArea({\r\n\t\theight: 50,\r\n\t\tleft: 20,\r\n\t\tright: 20,\r\n\t\ttop: 50,\r\n\t\tisFocused: false // custom property to keep track of current state\r\n\t});\r\n\ttextArea.addEventListener('focus', function(e)\r\n\t{\r\n\t\tTi.API.info('textArea has been focused.');\r\n\t\ttextArea.isFocused = true;\r\n\t});\r\n\ttextArea.addEventListener('blur', function(e)\r\n\t{\r\n\t\tTi.API.info('textArea has been blurred.');\r\n\t\ttextArea.isFocused = false;\r\n\t});\r\n\t\r\n\twin2.addEventListener('android:back', function(e)\r\n\t{\r\n\t\tif (textArea.isFocused)\r\n\t\t\ttextArea.blur();\r\n\t\telse \r\n\t\t\twin2.close();\r\n\t});\r\n\t\r\n\twin2.add(textArea);\r\n\twin2.open();\r\n});\r\n\r\nwin.add(button);\r\nwin.open();\r\n\r\n{code}\r\n\r\n\r\n*Expected behavior*\r\nWhen you run the app, press the button. When you tap on the Ti.UI.TextArea object, ddms should print out that it has been focused. When you tap the back button, it should hide the keyboard and print out that is has been blurred. When you repeat this once again, the same should happen. Now if you tap the back button once more, it should close the yellow window and return to the first window.\r\n\r\n*Summarized steps for expected behavior*\r\n1. Open app, press the button, check ddms -> no output.\r\n2. Tap on the text area, check ddms -> output: text area focused.\r\n3. Press the back button, check ddms -> output: text area blurred.\r\n4. Tap on text area again, check ddms -> output: text area focused.\r\n5. Press back button again, window should NOT close, check ddms -> output: text area blurred.\r\n6. Tap back button again -> window should close.\r\n\r\n\r\n*Actual behavior*\r\nWhen you run the app and press the button, the keyboard is NOT shown but ddms prints out that the Ti.UI.TextArea object has been focused. When you tap on the object, the keyboard not shows and not new events have been fired. When you tap on the back button, ddms prints out that the text area has been focused and blurred (2 print outs). If you tap on the object again to focus, NO new output is shown in ddms. If you now tap the back button, ddms prints out that the text area has been blurred AND it also closes the window. \r\n\r\n*Summarized steps to reproduce current issue (HTC Sensation 4G)*\r\n1. Open app, press the button, check ddms -> output: text area focused.\r\n2. Tap on the text area, check ddms -> no output.\r\n3. Press the back button, check ddms -> output: text area focused AND output: text area blurred.\r\n4. Tap on text area again, check ddms -> no output.\r\n5. Press back button again, window has been closed, check ddms -> output: text area blurred.\r\n\r\n\r\n*Notes*\r\n-Only tested on a HTC Sensation 4G and LG Optimus.\r\n-Both devices have different actual behaviors, however both of them are NOT the expected behavior.\r\n-When run on the iOS simulator, the focus and blur events are printed out correctly (obviously the 'android:back' events doesn't work on iOS, so it's working as expected).\r\n-Possible feature in the future: would be nice if the Ti.UI.TextArea object would expose a property of its current state (i.e. if it's currently focused or blurred).", "attachment": [], "flagged": false, "summary": "Android: Ti.UI.TextArea doesn't fire events properly", "creator": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "environment": "TiStudio: 2.0.1.201204132053\r\nTiSDK: 2.1.0v20120411111857\r\nRuntime engine: V8\r\nDevice(s): HTC Sensation 4G & LG Optimus", "comment": { "comments": [ { "id": "192685", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Marking bug as invalid because the behavior described as an error is the default android OS behavior. Also the android:back listener in the test case is useless as the app will behave the same way even without the listener added.", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-04-25T17:03:14.000+0000", "updated": "2012-04-25T17:03:14.000+0000" }, { "id": "415638", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-24T18:12:15.000+0000", "updated": "2017-03-24T18:12:15.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }