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

iOS: Removing a ListView while SearchBar has focus results in crash

    Details

    • Story Points:
      8
    • Sprint:
      2014 Sprint 25 SDK

      Description

      A popover that has a SearchBar attached to a ListView will crash if it hides will the SearchBar still has focus.

      Same goes for when the ListView is removed from its parent view while the SearchBar has focus, so that seems to be the actual problem.

      The crashlog is attached.

      Test case #1

      1. Install an app with the following code on an iPad (crashes on iOS Simulator as well, but doesn't show crashlog)
      2. Tap the button
      3. Tap the searchbar to focus
      4. Tap outside the popover to hide it
      5. App crashes after a second or so

      var w = Ti.UI.createWindow({
        backgroundColor: 'white'
      });
       
      var b = Ti.UI.createButton({
        title: 'Click'
      });
       
      b.addEventListener('click', function() {
       
        var cw = Ti.UI.createWindow({
          width: 300,
          height: 300
        });
       
        var lv = Ti.UI.createListView({
          searchView: Ti.UI.createSearchBar()
        });
       
        cw.add(lv);
       
        var p = Ti.UI.iPad.createPopover({
          width: 300,
          height: 300,
          contentView: cw
        });
       
        p.show({
          view: b
        });
       
      });
       
      w.add(b);
      w.open();
      

      Test case #2

      1. Install an app with the following code on an iOS device (crashes on iOS Simulator as well, but doesn't show crashlog)
      2. Tap the searchbar to focus
      3. Tap the button to remove the ListView
      4. App crashes after a second or so

      var w = Ti.UI.createWindow({
        backgroundColor: 'white'
      });
       
      var lv = Ti.UI.createListView({
        top: 100,
        searchView: Ti.UI.createSearchBar()
      });
       
      var b = Ti.UI.createButton({
        top: 30,
        title: 'Click me after focussing on search field'
      });
       
      b.addEventListener('click', function() {
        w.remove(lv);
      });
       
      w.add(b);
      w.add(lv);
       
      w.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vduggal Vishal Duggal (Inactive)
                Reporter:
                fokkezb Fokke Zandbergen
                Reviewer:
                Chee Kiat Ng (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code