{ "id": "86784", "key": "TIMOB-7748", "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": "15547", "description": "2013 Sprint 14", "name": "2013 Sprint 14", "archived": true, "released": true, "releaseDate": "2013-07-15" }, { "id": "15548", "description": "2013 Sprint 14 API", "name": "2013 Sprint 14 API", "archived": true, "released": true, "releaseDate": "2013-07-15" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-06-30T00:05:16.000+0000", "created": "2012-02-21T17:40:53.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "module_searchbar", "qe-testadded" ], "versions": [ { "id": "12570", "name": "Release 1.7.5", "archived": true, "released": true, "releaseDate": "2011-11-02" }, { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [ { "id": "15333", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "83195", "key": "TIMOB-6367", "fields": { "summary": "Android: searchBar.blur() - v8/rhino - Blurring search bar attempts to hide soft KB but fails", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "bijuexalture", "key": "bijuexalture", "displayName": "Biju pm", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2014-03-13T09:38:29.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": "Cancel button on a search bar doesn't appear to do anything: that is, it doesn't clear the search bar text, close the onscreen keyboard, or unfocus the search bar. It also doesn't generate an event, so there appears to be no workaround for it.\r\n\r\nCalling blur() on the search bar manually *does* close the onscreen keyboard, but the search bar maintains its focused appearance.\r\n\r\nThis also means that there seems to be no way to use the built-in cancel button on the search bar. It doesn't generate a 'blur' event, so there's no way to know when it's been pressed in order to use Eric's workaround.\r\n\r\nIn the following test case, note that:\r\n\r\n1) No matter what I do, the 'blur' event is not generated. In particular, clicking on a row in the table view does not cause the search bar to blur.\r\n2) Clicking the \"Cancel\" button does not clear the search field, blur the search field, or close the onscreen keyboard.\r\n3) The Back button will close the onscreen keyboard, but there doesn't seem to be any way to clear the text in the search bar short of erasing it one character at a time.\r\n\r\n\r\n{code}\r\nTi.UI.setBackgroundColor('#000');\r\n\r\nvar win = Ti.UI.createWindow({\r\n title:'Tableview with Filter',\r\n backgroundColor:'#fff'\r\n});\r\n\r\nfunction makeRow() {\r\n // generate random string of digits and capital English letters\r\n // see http://en.wikipedia.org/wiki/Base_36\r\n return Ti.UI.createTableViewRow({\r\n title: Math.random().toString(36).substring(7)\r\n });\r\n}\r\nvar searchbar = Ti.UI.createSearchBar({\r\n showCancel: true,\r\n hintText: \"This is the hint text\",\r\n});\r\nsearchbar.addEventListener('blur', function(e) {\r\n\tTi.API.info(\"Blur event called.\");\r\n});\r\nsearchbar.addEventListener('focus', function(e) {\r\n\tTi.API.info(\"Focus event called.\");\r\n});\r\nvar tbl = Ti.UI.createTableView({\r\n\r\n search: searchbar,\r\n});\r\nvar data = [];\r\nfor(var i=0; i<100; i++) {\r\n data.push(makeRow());\r\n}\r\ntbl.data = data;\r\nwin.add(tbl);\r\nwin.open();\r\n{code}\r\n\r\nThere actually is one case where I can generate the 'blur' event, but only on emulator. This is:\r\n\r\n- Close the keyboard using the back button.\r\n- Scroll down using the scroll wheel on the mouse.\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: Cancel button in search bar does not work", "creator": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Galaxy Tab 10.1 (3.1), Emulator (API Level 8), SDK 2.0.0.v20120216144634", "comment": { "comments": [ { "id": "240912", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The problem reproduces with release 3.0.2 and master release 3.1.0\r\n\r\ntested on\r\n\r\nTitanium Studio, build: 3.0.2.201302191606\r\nTitanium SDK version: 3.1.0 \r\nTitanium SDK version: 3.0.2 \r\nDevice: Samsung galaxy s duos Android version: 4.0.4\r\nAndroid Emulator: Android SDK version: 2.2\r\n\r\nOn Android, there are several issues with the current implementation,\r\nCheck Android Platform Implementation Notes http://docs.appcelerator.com/titanium/2.1/#!/api/Titanium.UI.SearchBar\r\n", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-06T07:38:06.000+0000", "updated": "2013-03-06T07:46:53.000+0000" }, { "id": "258969", "author": { "name": "bijuexalture", "key": "bijuexalture", "displayName": "Biju pm", "active": true, "timeZone": "Asia/Kolkata" }, "body": "fixed the issue. implement the backspace functionality for cancel button\r\nhttps://github.com/appcelerator/titanium_mobile/pull/4408", "updateAuthor": { "name": "bijuexalture", "key": "bijuexalture", "displayName": "Biju pm", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-06-21T10:16:22.000+0000", "updated": "2013-06-21T10:16:22.000+0000" }, { "id": "276362", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cancel button is working as expected.\nVerified fixed.\n\nTiSDK 3.2.0.v20131022050844\nCLI 3.2.0\nTitanium Studio 3.2.0.201310181940\n\nClosing.", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-23T16:48:36.000+0000", "updated": "2013-10-23T16:48:36.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }