Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25866] iOS : TiUISearchBar getter is returning value from proxy not from searchbar view

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2018-06-21T17:09:37.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.5.0
ComponentsiOS
LabelsSearchBar, ios
ReporterVijay Singh
AssigneeVijay Singh
Created2018-03-14T10:18:30.000+0000
Updated2018-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.

Comments

  1. Vijay Singh 2018-03-20

    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();
       
  2. Hans Knöchel 2018-06-21

    This can be tested together with TIMOB-25850.
  3. Samir Mohammed 2018-10-01

    *Closing ticket.* Verified fix in SDK version: 7.5.0.v20180928103802. TiUISearchBar is now returning the correct value from searchbar view. *Test Environment*
       APPC Studio: 5.1.0.201808080937
       iPhone 6 (12.0)
       APPC CLI: 7.0.7-master.4
       Operating System Name: Mac OS Mojave
       Operating System Version: 10.14
       Node.js Version: 8.9.1
       Xcode 10.0
       

JSON Source