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

iOS: A ListView's SearchBar doesn't filter when programmatically set

    Details

      Description

      Programmatically setting a SearchBar's value doesn't filter the ListView's rows where it is attached to, unless you focus/blur it. The value does show.

      Expected behaviour

      Setting the SearchBar value, either on creation or thereafter should filter the ListView (or TableView) it is attached to.

      Steps to reproduce

      1. Build an app with the following code
      2. Confirm that both line 6 and 30 properly set the value but doesn't filter
      3. Confirm that line 29 en 31 provide a workaround

      Code to reproduce

      var win = Ti.UI.createWindow({
        backgroundColor: 'white'
      });
       
      var searchView = Ti.UI.createSearchBar({
        value: 'Row 10'
      });
       
      var listView = Ti.UI.createListView({
        top: 20,
        searchView: searchView,
        sections: [Ti.UI.createListSection({
          items: (function() {
            var items = [];
            for (var i = 1; i < 30; i++) {
              items.push({
                properties: {
                  title: 'Row ' + i,
                  searchableText: 'Row ' + i
                }
              });
            }
            return items;
          })()
        })]
      });
       
      win.addEventListener('open', function() {
        // searchView.focus();
        searchView.value = 'Row 10';
        // searchView.blur();
      });
       
      win.add(listView);
      win.open();
      

        Attachments

          Activity

            People

            • Assignee:
              ssombhatla Srikanth Sombhatla (Inactive)
              Reporter:
              fokkezb Fokke Zandbergen
              Reviewer:
              Hans Knöchel
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration