[TIMOB-24975] Windows: SearchBar should show No Results text if there are no results in a search
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-11-16T01:46:26.000+0000 |
Affected Version/s | Release 6.1.1 |
Fix Version/s | Release 7.0.0 |
Components | Windows |
Labels | n/a |
Reporter | Ewan Harris |
Assignee | Kota Iguchi |
Created | 2017-07-18T09:46:09.000+0000 |
Updated | 2017-11-16T01:46:41.000+0000 |
Description
According to the UWP Design and Pattern guidelines for AutoSuggestBox, when there are no results shown there should be a single result shown saying 'No Results' (or something similar), currently we do not display anything, while that behaviour is different to our Android implementation (not sure on iOS), we should adhere to the platforms guidelines
https://docs.microsoft.com/en-us/windows/uwp/controls-and-patterns/auto-suggest-box (see Do's and Don'ts)
var _window = Ti.UI.createWindow({ backgroundColor: 'green' });
var searchBar = Ti.UI.createSearchBar();
var data = [];
for (var i = 0; i < 25; i++) {
data.push({ title: Row ${i}
});
}
var tableView = Ti.UI.createTableView({
search: searchBar,
data: data
});
_window.add(tableView);
_window.open()
I think there are two different paths to this that we need to consider * Developer has the SearchBar tied to a TableView or ListView and user submits the query ** We need to append a row that lists
No Results for <search>
orNo Results
(see the app search on Windows 10 Mobile for this) - maybe this is tied to whether they use * User is searching in the SearchBar for something with no results ** We need to displayNo Results for <search>
orNo Results
in the SearchBar results section (see the search in the Settings app on desktop or mobile)It also just occurred to me that if we do this in source ourselves it would more than likely be completely lacking support i18n, maybe we could add a Windows only property (and i18n property) to allow a user specify the text to be shown to a user when there are no results from the search?
https://github.com/appcelerator/titanium_mobile_windows/pull/1081
Passed FR! Using this environment: Node Version: 8.9.1 NPM Version: 5.5.1 Windows OS 10.0.14393 Appc CLI: 7.0.0-master.13 Appc CLI NPM: 4.2.11-2 Titanium SDK version: 7.0.0.v20171115153702 Appcelerator Studio vers 4.10.0 Windows Phone 10.0.15063