{ "id": "105913", "key": "TIMOB-11943", "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": "14786", "description": "2012 Sprint 26", "name": "2012 Sprint 26", "archived": true, "released": true, "releaseDate": "2012-12-31" } ], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2018-06-29T20:55:56.000+0000", "created": "2012-12-04T10:06:03.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [ { "id": "56660", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "93594", "key": "TIMOB-9680", "fields": { "summary": "Android: Textfield: The focus on textfield does not happen through textfield focus method", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": null, "updated": "2018-06-29T20:56:00.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": "h1. Problem description\r\nWhen a TextArea is focused, and the user clicks the back button to hide the soft keyboard, the blur event is not fired. It is not also possible to use the 'android:back' event, as it is not fired when hiding the keyboard.\r\n\r\nh1. Steps to reproduce\r\n- Use the following code to test the bug.\r\n- Click on the black window to open a second one with a TextArea\r\n- Click on it to show the keyboard\r\n- Hit the back button: the 'blur' and 'android:back' events are not fired when keyboard is being hidden\r\n\r\n{code}\r\n\r\n// Create a window\r\nvar root = Ti.UI.createWindow({\r\n\tbackgroundColor : 'black',\r\n\tmodal: true\r\n});\r\n\r\nroot.addEventListener('click', function() {\r\n var win = Ti.UI.createWindow({\r\n backgroundColor : 'white',\r\n modal: true\r\n });\r\n \r\n var toolbar = Titanium.UI.createTextArea({\r\n height: 37,\r\n width: 200,\r\n font: {fontSize:16,fontFamily:'ARIAL', fontWeight:'solid'},\r\n color: '#000',\r\n borderWidth: 1,\r\n borderColor: '#828281',\r\n borderRadius: 12,\r\n suppressReturn: false,\r\n scrollable: false\r\n });\r\n \r\n toolbar.addEventListener('blur', function() {\r\n alert('blurrrred');\r\n });\r\n \r\n win.addEventListener('android:back', function() {\r\n alert('baaaack');\r\n });\r\n \r\n win.add(toolbar);\r\n win.open(); \r\n})\r\n\r\nroot.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: blur event not called when keyboard is hidden", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Android\r\nSDK 2.1.4", "closedSprints": [ { "id": 291, "state": "closed", "name": "2015 Sprint 01 SDK", "startDate": "2015-01-03T01:00:00.000Z", "endDate": "2015-01-17T01:00:00.000Z", "completeDate": "2015-01-19T17:24:40.828Z", "originBoardId": 114 }, { "id": 309, "state": "closed", "name": "2015 Sprint 02 SDK", "startDate": "2015-01-17T01:00:16.697Z", "endDate": "2015-01-31T01:00:00.000Z", "completeDate": "2015-02-02T14:36:09.696Z", "originBoardId": 114 }, { "id": 272, "state": "closed", "name": "2014 Sprint 25 SDK", "startDate": "2014-12-08T22:49:31.264Z", "endDate": "2014-12-22T01:00:00.000Z", "completeDate": "2015-01-05T18:18:28.523Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "230952", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The 'blur' event is attached to the textfield and not the soft keyboard itself, so it's expected that no blur event its fired.\r\n\r\nSimilarly, the 'android:back' event is tied to the activity and not the soft keyboard.\r\n\r\nNative android does not expose a way for us to determine whether a soft keyboard is up or not. The API for inputmethodmanager is more generic in android, and we don't have anything specifically for soft keyboards.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-11T23:14:06.000+0000", "updated": "2012-12-11T23:14:06.000+0000" }, { "id": "239989", "author": { "name": "lhgravendeel", "key": "lhgravendeel", "displayName": "Leendert Gravendeel", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I would very much appreciate it if this bug was fixed though.\r\nHave you already tried implementing onKeyPreIme in TiEditText (inside TiUIText), and checking for an incoming key code KeyEvent.KEYCODE_BACK?", "updateAuthor": { "name": "lhgravendeel", "key": "lhgravendeel", "displayName": "Leendert Gravendeel", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-27T13:04:46.000+0000", "updated": "2013-02-27T13:04:46.000+0000" }, { "id": "251274", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As per the comment by Allen, this is invalid bug.So closing it.", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-10T11:58:49.000+0000", "updated": "2013-05-10T11:58:49.000+0000" }, { "id": "328761", "author": { "name": "tdtrinh", "key": "tdtrinh", "displayName": "Iker", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Shyam Bhadauria: Please..., you cannot just close this topic like that, at least your development team should implement in the new feature to solve our problem! Since you said like that How the developer can believe in Titanium? How we solve our issue?", "updateAuthor": { "name": "tdtrinh", "key": "tdtrinh", "displayName": "Iker", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-21T06:59:25.000+0000", "updated": "2014-10-21T06:59:25.000+0000" }, { "id": "331453", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hpham] to investigate.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-11-10T22:02:53.000+0000", "updated": "2014-11-10T22:02:53.000+0000" }, { "id": "334698", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "There is no native method to determine whether the keyboard is dismissed or not. But we can intercept key events to handle the BACK key specially, like this commit https://github.com/appcelerator/titanium_mobile/pull/6431/files .\r\n*Caveat*: The new event \"dismissKeyboard\" is only fired when the keyboard is dismissed by pressing the BACK key. If it is dismissed by pressing the DONE key, the event \"return\" will be fired instead.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-12-03T23:52:09.000+0000", "updated": "2014-12-04T19:08:19.000+0000" }, { "id": "334794", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "\"dismissKeyboard\" would be very useful.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-12-04T08:33:46.000+0000", "updated": "2014-12-04T08:33:46.000+0000" }, { "id": "350203", "author": { "name": "dyan02", "key": "dyan02", "displayName": "ardy wongso", "active": true, "timeZone": "America/Los_Angeles" }, "body": "sorry, but i cant find dismissKeyboard in documentation, when this will be available?", "updateAuthor": { "name": "dyan02", "key": "dyan02", "displayName": "ardy wongso", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-04-21T03:33:51.000+0000", "updated": "2015-04-21T03:33:51.000+0000" }, { "id": "365815", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As noted, there is no native method for this so we are uncomfortable taking a hack to support it. However, you can use the PR attached to accomplish it on your own SDK if you like.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-10-05T16:33:08.000+0000", "updated": "2015-10-05T16:33:15.000+0000" }, { "id": "438873", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The TextField/TextArea {{focus()}} and {{blur()}} functions are now working as expected on Android as of Titanium 7.0.0. The {{blur()}} function will now dismiss the virtual keyboard and remove the focus from the field.\r\nWas resolved by ticket: [TIMOB-9680]\r\n\r\nNote that collapsing the virtual keyboard will NOT remove the focus from the TextField/TextArea. This is the correct native behavior on Android since the end-user can also enter text via physical keyboard as well (ex: bluetooth keyboard or slide-out keyboard). Switching the focus to another field or calling the {{blur()}} method is the only means of removing the focus.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-29T20:55:03.000+0000", "updated": "2018-06-29T20:55:03.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }