[TIMOB-28109] iOS: Top section in grouped ListView disappears when tapping SearchBar or on orientation change
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-06-17T10:06:52.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 10.0.1 |
Components | iOS |
Labels | ListView, grouped, ios, searchbar, section |
Reporter | Hans Knöchel |
Assignee | Joshua Quick |
Created | 2020-09-03T12:44:29.000+0000 |
Updated | 2021-06-17T10:06:52.000+0000 |
Description
Since the ListView search bar was moved to the
UISearchController
, there is a bug that makes the layout of the list section "collapse". This is quite critical for us, because it destroys our layout.
To debug: The following log is displayed in the console, indicating the underlaying issue:
[DEBUG] Presenting view controllers on detached view controllers is discouraged <TiViewController: 0x7fa06f532c40>.
Probably also reproducible in common sample apps and test suites that include a list view + search. Sample code to reproduce:
var win = Ti.UI.createWindow({
backgroundColor: '#fff'
});
var listView = Ti.UI.createListView({ style: Ti.UI.iOS.ListViewStyle.GROUPED });
listView.sections = [Ti.UI.createListSection({ items: [{ properties: { itemId: 1, height: 43, title: 'Test item 1' } }, { properties: { itemId: 2, height: 43, title: 'Test item 2' } }] })];
listView.searchView = Ti.UI.createSearchBar();
win.add(listView);
win.open();
Attachments
File | Date | Size |
---|---|---|
ListViewSearchGroupTest.js | 2021-06-10T17:43:19.000+0000 | 874 |
Simulator Screen Shot - iPhone 11 Pro - 2020-09-04 at 10.12.45 Kopie.jpg | 2020-09-04T08:16:35.000+0000 | 191863 |
The issue happens with Ti.UI.iOS.ListViewStyle.GROUPED not with Ti.UI.iOS.ListViewStyle.PLAIN
Yep thats correct! :) Have you found the root cause already? If you create a sample native project and compare it, you can likely see what's causing it.
This issue will happen if the app changes orientation too. Looks like a relayout issue. You can work-around it by setting the first section's "headerTitle" to " " (a string with a space), but it will add a slight amount of height to the top.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/12879
merged to master
backport merged