Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-19161

iOS: Sections not honored while searchBar focused

    Details

    • Type: Bug
    • Status: Open
    • Priority: None
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: iOS
    • Environment:

      Ti.SDK 3.4.1.GA, 3.5.0.GA
      Ti.Studio 3.4.1
      iOS 7.1, 8.1

      Description

      Hey there,
      i recently discovered an issue regarding the ListView behavior while focusing the SearchBar. The workaround is a ListView with a custom section-headerView in it. When focusing the search and type a keyword, which is related by the "searchableText" attribute in the ListItem, the item is found properly, but the related section is not shown (although the "keepSectionsInSearch" attribute is set to true).

      Expected result:

      • show section headers
      • accept custom ListView-styles (backgroundColor, separatorStyle, ..)

      Given result:

      • sections headers do not appear
      • custom ListView styles are not honored

      This is an iOS-specific bug, android works well.

      Code example:

      index.js

      var win = Ti.UI.createWindow({backgroundColor: 'white', fullscreen: true});
      var search = Titanium.UI.createSearchBar({
       barColor:'#000', 
       showCancel:true,
       height:43,
       top:0,
      });
      search.addEventListener('cancel', function(){
          search.blur();
      });
       
      var listView = Ti.UI.createListView({searchView: search, caseInsensitiveSearch: true});
       
      var listSection = Ti.UI.createListSection({ headerTitle: 'Fruits'});
      var fruits = ['Papaya', 'Peach', 'Pear', 'Persimmon', 'Pineapple', 'Pluot', 'Pomegranate'];
      var data = [];
      for (var i = 0; i < fruits.length; i++) {
      data.push({
          properties: {title: fruits[i], searchableText: fruits[i]}
      });
      }
      listSection.setItems(data);
      listView.addEventListener('noresults', function(e){
          alert("No results found!");
      });
      listView.sections = [listSection];
      win.add(listView);
      win.open();
      

      More infos on this case (Thanks to Sharif): http://developer.appcelerator.com/question/180553/listview-ios-sections-not-honored-while-searchbar-focused

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hknoechel Hans Knöchel
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-20098
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code