Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28109] iOS: Top section in grouped ListView disappears when tapping SearchBar or on orientation change

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2021-06-17T10:06:52.000+0000
Affected Version/sn/a
Fix Version/sRelease 10.0.1
ComponentsiOS
LabelsListView, grouped, ios, searchbar, section
ReporterHans Knöchel
AssigneeJoshua Quick
Created2020-09-03T12:44:29.000+0000
Updated2021-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

FileDateSize
ListViewSearchGroupTest.js2021-06-10T17:43:19.000+0000874
Simulator Screen Shot - iPhone 11 Pro - 2020-09-04 at 10.12.45 Kopie.jpg2020-09-04T08:16:35.000+0000191863

Comments

  1. Vijay Singh 2020-09-29

    The issue happens with Ti.UI.iOS.ListViewStyle.GROUPED not with Ti.UI.iOS.ListViewStyle.PLAIN
  2. Hans Knöchel 2020-09-29

    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.
  3. Joshua Quick 2021-06-02

    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.
  4. Joshua Quick 2021-06-10

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/12879
  5. Christopher Williams 2021-06-16

    merged to master
  6. Ewan Harris 2021-06-17

    backport merged

JSON Source