[TIMOB-19161] iOS: Sections not honored while searchBar focused
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | TCSupportTriage, ios, listitem, listview, searchbar |
Reporter | Hans Knöchel |
Assignee | Unknown |
Created | 2015-02-03T21:26:58.000+0000 |
Updated | 2018-02-28T19:55:22.000+0000 |
Description
Hey there,
i 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).
Expected result:
- show section headers
- accept custom ListView-styles (backgroundColor, separatorStyle, ..)
Given result:
- sections headers do not appear
- custom ListView styles are not honored
This is an iOS-specific bug, android works well.
Code example:
var win = Ti.UI.createWindow({backgroundColor: 'white', fullscreen: true});
var search = Titanium.UI.createSearchBar({
barColor:'#000',
showCancel:true,
height:43,
top:0,
});
search.addEventListener('cancel', function(){
search.blur();
});
var listView = Ti.UI.createListView({searchView: search, caseInsensitiveSearch: true});
var listSection = Ti.UI.createListSection({ headerTitle: 'Fruits'});
var fruits = ['Papaya', 'Peach', 'Pear', 'Persimmon', 'Pineapple', 'Pluot', 'Pomegranate'];
var data = [];
for (var i = 0; i < fruits.length; i++) {
data.push({
properties: {title: fruits[i], searchableText: fruits[i]}
});
}
listSection.setItems(data);
listView.addEventListener('noresults', function(e){
alert("No results found!");
});
listView.sections = [listSection];
win.add(listView);
win.open();
More infos on this case (Thanks to Sharif): http://developer.appcelerator.com/question/180553/listview-ios-sections-not-honored-while-searchbar-focused
Hello [~rtlechuga], We 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. *Testing environment:* Titanium SDK: 4.0.0.GA Titanium CLI: 4.0.1 iOS Simulator: 8.1 OS X Version: 10.9.5, Appcelerator Studio: 4.1.0.201506261427 *Testing Code:*