Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25491] iOS: Ti.UI.SearchBar not slide down when set visible a view on top

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-11-28T16:44:01.000+0000
Affected Version/sRelease 6.3.0
Fix Version/sRelease 7.0.0
ComponentsiOS
Labelsios, iphone
ReporterMichele Cavalcanti
AssigneeVijay Singh
Created2017-11-08T10:08:58.000+0000
Updated2017-11-28T20:30:09.000+0000

Description

Hi, I have a SearchBar inside a Listview and when onChange event is fired i want show a View on top of ListView. With sdk 6.3.0 the Searchbar not slide down but with skd 6.1.2 the SearchBar slide down. I have attach a complete example code. You can test my code with sdk 6.1.2 and 6.3.0 and you can see different behavior

Attachments

FileDateSize
bugios.zip2017-11-08T09:44:12.000+000010007525

Comments

  1. Vijay Singh 2017-11-21

    PR : https://github.com/appcelerator/titanium_mobile/pull/9622 Test Case 1 (TiUIListView) -
       var rows = [];
       for (var i = 0; i < 20; i++) {
           rows.push({ properties: { title: 'Row '+ i , backgroundColor: 'red', searchableText:'Row '+i}});
       }
       var win = Ti.UI.createWindow({
         title: 'TEST',
         backgroundColor: 'white',
         layout: 'vertical'
       }); 
       var sb = Ti.UI.createSearchBar();
        
       var ls = Ti.UI.createListSection({
         items: rows
       });
        var lv = Ti.UI.createListView({
           sections: [ls],
           searchView: sb,
           left: 30,
           right: 20
       });
        
       sb.setHintText("test");
        sb.addEventListener('change', function(e){
         view.setHeight(50);
         Ti.API.info(e.value);
       });
        //when the return key is hit, remove focus from our searchBar
       sb.addEventListener('return', function(e){
           view.setHeight(0);
           sb.blur();
       });
       sb.addEventListener('cancel', function(e){
           view.setHeight(0);
       });
       lv.addEventListener('itemclick', function(e) {
           Ti.API.info('click at index: ' + e.itemIndex);
       });
       
       var view = Ti.UI.createView({
         backgroundColor : 'blue',
         height : 0,
       });
        view.addEventListener('click', function(e){
           Ti.API.info('view clicked');
         });
       win.add(view);
       win.add(lv);
       win.open();
       
    Test Case 2 (TiUITableView) -
       var rows = [];
       for (var i = 0; i < 10; i++) {
           rows.push({ title: 'Row '+ i});
       }
       
       var win = Ti.UI.createWindow({
         backgroundColor: 'red',
         layout : 'vertical'
       });
         
       var sb = Ti.UI.createSearchBar();
       var lv = Ti.UI.createTableView({
           data: rows,
           search: sb,
           top : 50,
           left : 30
       });
        
        sb.setHintText("test");
        sb.addEventListener('change', function(e){
         Ti.API.info(e.value);
         view.setHeight(50);
       });
        
       sb.addEventListener('return', function(e){
       sb.blur();
       view.setHeight(0);
       });
        
       sb.addEventListener('cancel', function(e){
             view.setHeight(0);
       });
       lv.addEventListener('click', function(e) {
           Ti.API.info('click at index: ' + e.index);
           Ti.API.info('clicked row data: ' + e.rowData.title);
        
       })
        
        var view = Ti.UI.createView({
         backgroundColor : 'blue',
         height : 0,
       });
        view.addEventListener('click', function(e){
           Ti.API.info('view clicked');
         });
       win.add(view);
       win.add(lv);
       win.open();
       
       
    Test Case 3 (Offset in ListView):
       var rows = [];
       for (var i = 0; i < 20; i++) {
           rows.push({ properties: { title: 'Row '+ i , backgroundColor: 'red', searchableText:'Row '+i}});
       }
       var win = Ti.UI.createWindow({
         backgroundColor: 'white'
       }); 
       var sb = Ti.UI.createSearchBar();
        
       var ls = Ti.UI.createListSection({
         items: rows
       });
        
       var lv = Ti.UI.createListView({
         sections: [ls],
         searchView: sb,
         top: 100,
         left: 30,
         right: 20
       });
        
       sb.addEventListener('change', function(e){
         Ti.API.info(e.value);
       });
       
       // when the return key is hit, remove focus from our searchBar
       sb.addEventListener('return', function(e){
           sb.blur();
       });
       
       lv.addEventListener('itemclick', function(e) {
           Ti.API.info('click at index: ' + e.itemIndex);
       });
        
       win.add(lv);
       win.open();
       
  2. Vijay Singh 2017-11-21

    This ticket fix the issue TIMOB-25528 and TIMOB-25532 as well. So we have to verify test cases mentioned in tickets TIMOB-25528 and TIMOB-25532.
  3. Abir Mukherjee 2017-11-28

    FR passed, PR merged.
  4. Eric Wieber 2017-11-28

    Verified in SDK build 7.0.0.v20171128115332

JSON Source