{ "id": "144132", "key": "TIMOB-19161", "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": null, "resolutiondate": null, "created": "2015-02-03T21:26:58.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "TCSupportTriage", "ios", "listitem", "listview", "searchbar" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T19:55:22.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Hey there,\r\ni recently discovered an issue regarding the ListView behavior while focusing the SearchBar. The workaround is a ListView with a custom section-headerView in it. When focusing the search and type a keyword, which is related by the \"searchableText\" attribute in the ListItem, the item is found properly, but the related section is not shown (although the \"keepSectionsInSearch\" attribute is set to true).\r\n\r\nExpected result:\r\n- show section headers\r\n- accept custom ListView-styles (backgroundColor, separatorStyle, ..)\r\n\r\nGiven result:\r\n- sections headers do not appear\r\n- custom ListView styles are not honored\r\n\r\nThis is an iOS-specific bug, android works well.\r\n\r\nCode example:\r\n{code:title=index.js|borderStyle=solid}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white', fullscreen: true});\r\nvar search = Titanium.UI.createSearchBar({\r\n barColor:'#000', \r\n showCancel:true,\r\n height:43,\r\n top:0,\r\n});\r\nsearch.addEventListener('cancel', function(){\r\n search.blur();\r\n});\r\n \r\nvar listView = Ti.UI.createListView({searchView: search, caseInsensitiveSearch: true});\r\n \r\nvar listSection = Ti.UI.createListSection({ headerTitle: 'Fruits'});\r\nvar fruits = ['Papaya', 'Peach', 'Pear', 'Persimmon', 'Pineapple', 'Pluot', 'Pomegranate'];\r\nvar data = [];\r\nfor (var i = 0; i < fruits.length; i++) {\r\ndata.push({\r\n properties: {title: fruits[i], searchableText: fruits[i]}\r\n});\r\n}\r\nlistSection.setItems(data);\r\nlistView.addEventListener('noresults', function(e){\r\n alert(\"No results found!\");\r\n});\r\nlistView.sections = [listSection];\r\nwin.add(listView);\r\nwin.open();\r\n{code}\r\n\r\nMore infos on this case (Thanks to Sharif): http://developer.appcelerator.com/question/180553/listview-ios-sections-not-honored-while-searchbar-focused", "attachment": [], "flagged": false, "summary": "iOS: Sections not honored while searchBar focused", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Ti.SDK 3.4.1.GA, 3.5.0.GA\r\nTi.Studio 3.4.1\r\niOS 7.1, 8.1", "comment": { "comments": [ { "id": "356927", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~rtlechuga],\r\n\r\nWe have tested this issue in latest environment . It’s a valid bug. When we search in ListView , related section is not shown on iOS but its perfectly works on Android.\r\n\r\n*Testing environment:*\r\nTitanium SDK: 4.0.0.GA \r\nTitanium CLI: 4.0.1\r\niOS Simulator: 8.1\r\nOS X Version: 10.9.5,\r\nAppcelerator Studio: 4.1.0.201506261427\r\n\r\n*Testing Code:*\r\n{code}var win = Ti.UI.createWindow({\r\n\tbackgroundColor : 'brown',\r\n\tfullscreen : true\r\n});\r\nvar search = Titanium.UI.createSearchBar({\r\n\tbarColor : '#000',\r\n\tshowCancel : true,\r\n\theight : 43,\r\n\ttop : 0,\r\n});\r\nsearch.addEventListener('cancel', function() {\r\n\tsearch.blur();\r\n});\r\n \r\nvar listView = Ti.UI.createListView({\r\n\tsearchView : search,\r\n\tcaseInsensitiveSearch : true,\r\n\tkeepSectionsInSearch : true\r\n});\r\n \r\nvar listSection = Ti.UI.createListSection({\r\n\theaderTitle : 'Fruits',\r\n \r\n});\r\n \r\nvar fruits = ['Papaya', 'Peach', 'Pear', 'Persimmon', 'Pineapple', 'Pluot', 'Pomegranate'];\r\nvar data = [];\r\nfor (var i = 0; i < fruits.length; i++) {\r\n\tdata.push({\r\n\t\tproperties : {\r\n\t\t\ttitle : fruits[i],\r\n\t\t\tsearchableText : fruits[i]\r\n\t\t}\r\n\t});\r\n}\r\nlistSection.setItems(data);\r\n \r\nlistView.sections = [listSection];\r\n \r\nwin.add(listView);\r\nwin.open();\r\n{code}\r\n", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-07-05T04:31:40.000+0000", "updated": "2016-11-06T20:23:37.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }