[TIMOB-25866] iOS : TiUISearchBar getter is returning value from proxy not from searchbar view
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2018-06-21T17:09:37.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 7.5.0 |
| Components | iOS |
| Labels | SearchBar, ios |
| Reporter | Vijay Singh |
| Assignee | Vijay Singh |
| Created | 2018-03-14T10:18:30.000+0000 |
| Updated | 2018-10-01T12:32:33.000+0000 |
Description
In TI.UI.SearchBar, the getters are not implemented properly. It simply returns the value which is set in it's proxy, not the actual native value. Ideally, it should return the value by fetching it natively from the underlaying UISearchBar. Currently, for whatever you set the value of property, it will return same even though that value is not passed to search-bar.
PR - https://github.com/appcelerator/titanium_mobile/pull/9947 Test Case -
var win = Ti.UI.createWindow({ backgroundColor: 'white' }); var searchBar = Titanium.UI.createSearchBar({ top: 40, showBookmark: true, showCancel: true, color : 'blue', hintTextColor: 'red', barColor: 'gray', hintText: 'Search text', value: 'This is search bar getter test', keyboardType: Ti.UI.KEYBOARD_TYPE_NUMBER_PAD, autocorrect: true, autocapitalization : Ti.UI.TEXT_AUTOCAPITALIZATION_ALL, keyboardAppearance: Ti.UI.KEYBOARD_APPEARANCE_LIGHT, prompt: 'prompt value', style: Ti.UI.iOS.SEARCH_BAR_STYLE_PROMINENT, }); win.addEventListener('click', function(e){ Ti.API.info(searchBar.showBookmark); Ti.API.info(searchBar.showCancel); Ti.API.info(searchBar.color); Ti.API.info(searchBar.hintTextColor); Ti.API.info(searchBar.barColor); Ti.API.info(searchBar.hintText); Ti.API.info(searchBar.value); Ti.API.info(searchBar.keyboardType); Ti.API.info(searchBar.autocorrect); Ti.API.info(searchBar.autocapitalization); Ti.API.info(searchBar.keyboardAppearance); Ti.API.info(searchBar.prompt); Ti.API.info(searchBar.style); }); win.add(searchBar); win.open();This can be tested together with TIMOB-25850.
*Closing ticket.* Verified fix in SDK version:
7.5.0.v20180928103802.TiUISearchBaris now returning the correct value fromsearchbarview. *Test Environment*