[TIMOB-28308] Android: ListView "noresults" event no longer fired as of 9.3.0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Unresolved |
Affected Version/s | Release 9.3.0 |
Fix Version/s | Release 9.3.1 |
Components | Android |
Labels | ListView, SearchBar, android, regression, searchview |
Reporter | Joshua Quick |
Assignee | Gary Mathews |
Created | 2021-01-04T20:53:04.000+0000 |
Updated | 2021-01-21T18:18:56.000+0000 |
Description
*Summary:*
As of Titanium 9.3.0, Android's Notice that
ListView
no longer fires a "noresults" event when the text you enter into the SearchBar
/SearchView
shows no results in the list.
https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ListView-event-noresults
*Steps to reproduce:*
Build and run the below on Android.
Tap on the top search bar.
Enter "x" into the search.
Notice that "@@@ noresults"
is not logged when it should.
function createListViewSectionItems() {
var items = [];
for (var index = 1; index <= 100; index++) {
// items.push({ properties: { title: "Row " + index } });
items.push({ properties: { title: "Row " + index, searchableText: "Row " + index } });
// items.push({ properties: { title: "Row " + index, searchableText: "Test " + index } });
}
return items;
}
var window = Ti.UI.createWindow();
var listView = Ti.UI.createListView({
sections: [Ti.UI.createListSection({
headerTitle: "ListView",
items: createListViewSectionItems(),
})],
searchView: Ti.UI.createSearchBar({ showCancel: true }),
// searchView: Ti.UI.Android.createSearchView(),
});
listView.addEventListener("noresults", () => {
Ti.API.info("@@@ noresults");
});
window.add(listView);
window.open();
*Note:*
This is the code we lost since upgrading to RecyclerView in 9.3.0.
https://github.com/appcelerator/titanium_mobile/blob/9_2_X/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiListView.java#L729-L744
master: https://github.com/appcelerator/titanium_mobile/pull/12363
FR Passed, Waiting on Jenkins build and backport.
squash merged to master, backport PR to 9_3_X is merged for 9.3.1 target.