[TIMOB-17001] iOS: Search disappears from ListView
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-11-04T22:36:24.000+0000 |
Affected Version/s | Release 3.2.3 |
Fix Version/s | Release 3.4.0 |
Components | iOS |
Labels | defect, ios, iphone |
Reporter | Thomas Wilkinson |
Assignee | Jon Alter |
Created | 2014-05-20T20:59:22.000+0000 |
Updated | 2017-03-23T22:26:42.000+0000 |
Description
ListView with a search, where the itemclick event opens a window.
This defect works in the ElementsOfListView tutorial app ( https://github.com/appcelerator-services/ElementsOfListView ). The customer is having the same issue in their own app.
1) Wait for the elements list to open
2) Scroll down a bit, half a screen or more.
3) Click on an element (the name, not the symbol) and wait for the new window to open.
4) Close that new window by clicking the "Done" button.
5) Scroll back up to the top. Notice there is a white space where the Search was.
At this point, it should be noted that the search is still there, it just appears blank. If you click into it, it'll appear as it should.
Edit:
Simpler test case, copy and paste into app.js
function MainWindow() {
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
var items = [];
for(var i = 0; i < 100; i++) {
items.push({
properties:{
title: 'Row #' + (i + 1),
searchableText: 'Row #' + (i + 1)
}
});
}
var listViewSection = Ti.UI.createListSection({
items: items
});
var searchBar = Ti.UI.createSearchBar();
var listView = Ti.UI.createListView({
sections: [listViewSection],
searchView: searchBar
});
win.add(listView);
listView.addEventListener('itemclick', function(){
SecondWindow().open({modal:true});
});
return win;
}
function SecondWindow() {
var navWindow = Ti.UI.iOS.createNavigationWindow();
var win = Ti.UI.createWindow({
backgroundColor: 'gray'
});
var closeBtn = Ti.UI.createButton({
title: 'close'
});
win.rightNavButton = closeBtn;
navWindow.window = win;
closeBtn.addEventListener('click', function(){
navWindow.close();
});
return navWindow;
}
MainWindow().open();
I'm going to bump up the priority because there is no workaround on it.
Tested on: Mac OSX 10.9.3 Appcelerator Studio, build: 3.3.0.201406061445 Titanium SDK, build: 3.3.0.v20140606154912, 3.2.3.GA, 3.2.0.GA Titanium CLI, build: 3.3.0-beta3 Alloy: 1.4.0-beta2 iPhone 5S (7.0.6) Reproduced this issue using the latest master SDK, latest stable SDK and 3.2.0.GA SDK. Scrolled down half a screen or more. Opened a new window, closed the new window and tapped the status bar to jump to the top of the listView. Search bar is no longer present. Opening a new window and closing it again will bring back the search bar.
Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/5938
I just tested this with continuous build 3.4.0.v20140813022514 and if you search and tap a search result the app crashes. Also crashes if you have a search keyword entered and tap the X in the search field to clear. [ERROR] : The application has crashed with an uncaught exception 'UIViewControllerHierarchyInconsistency'. [ERROR] : Reason: [ERROR] : A view can only be associated with at most one view controller at a time! View
Reopening the issue since the app crashes with given above code while searching and tapping search result. Verified with: Appcelerator Studio:3.4.0.201408180158 Sdk:3.4.0.v20140815142514 alloy:1.5.0-dev titanium:3.4.0-dev titanium-code-processor:1.1.1 acs:1.0.16 npm:1.3.2 OS:Maverick(10.9.4) xcode: Xcode6Beta5 Device:iPhone5c(v7.1.1)
Confirmed above crash PR: https://github.com/appcelerator/titanium_mobile/pull/5996
Look like that crash is the same I reported TC-4611
Closing ticket as fixed. Verified the search field does not disappear in ListView after scrolling pass halfway. Tested on: Appcelerator Studio, build: 3.4.0.201408291834 SDK build: 3.4.0.v20140829184521 CLI: 3.4.0-dev Alloy: 1.5.0-dev Xcode: 6-beta6 Devices: iphone 5 (7.0.6)
This ticket should be reopened since the above PR is fixing a crash in the example, not the actual reported issue. This issue still persists in 3.4.0.GA even without first having to open a window over it. I'm trying to come up with a good test case, but reproducing is hard since it happens about 1 out of 10 times in an enterprise app I'm doing which involves a lots of interconnected code around the list view.
O wait, I see there's another PR. Well, anyway... problem still exists in 3.4.0.GA for me.
[~fokke] We evidently need a test case to reproduce before we can reopen. Please see if you can arrive at one (I know it is complicated).
I haven't seen it anymore since iOS 8.1 so I think it was an 8.0 bug, since it was popping up there daily.
Still seen it in 8.1.1
Hello [~jalter]:
Testing Environments
iphone 6 - iOS 8.1.2 - Mobile SDK 3.4.1 - OK ipod touch - iOS 8.1.1 - Mobile SDK 3.4.1 - OK iphone 6+ sim - iOS 8.1 - Mobile SDK 3.4.1 - OK.Instructions to reproduce
1. Create new mobile project 2. Add the sample code in the issue to app.js 3. Run it in device 4. Scroll to row 30+ 5. Click in a row 6. Click Done 7. Scroll to the top and check the searchActual results
The search is still there and says search in all the described test in different environments.Closing as fixed.