Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15526] iOS: Tableview's search filter does not render results correctly in a Popover

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2014-03-06T18:17:55.000+0000
Affected Version/sRelease 3.2.1
Fix Version/s2014 Sprint 05, 2014 Sprint 05 API, Release 3.2.3, Release 3.3.0
ComponentsiOS
Labelspopover, qe-testadded, supportTeam
ReporterTom Raggett
AssigneeVishal Duggal
Created2013-10-17T08:40:09.000+0000
Updated2014-03-12T23:16:43.000+0000

Description

If I create a Popover containing a TableView with a SearchBar, when I filter the TableView by typing in the SearchBar, I see the (correct) filtered TableViewRows overlaid on the full unfiltered table. You can see this in the attached screenshot where Row 4 is at the top and the bottom of the display having typed 4 in the SearchBar. This is visually bad, although the click behaviour is correct (you can click on the filtered rows only). Work around is to use a separate SearchBar and populate the table based on change events. I would prefer that it just worked. Test code has instructions to see the correct behaviour outside a Popover.
// Titanium SearchBar+TableView in Popover shows filtered items over all table items
var win = Titanium.UI.createWindow({backgroundColor:'white'});

var button1 = Titanium.UI.createButton({
	title:'Show popover',
	borderColor: 'black',
	top: 40
});

win.add(button1);

var data = [];
data[0] = Ti.UI.createTableViewRow({title:'Row 1'});
data[1] = Ti.UI.createTableViewRow({title:'Row 2'});
data[2] = Ti.UI.createTableViewRow({title:'Row 3'});
data[3] = Ti.UI.createTableViewRow({title:'Row 4'});
	
var search = Ti.UI.createSearchBar({});

var table = Ti.UI.createTableView({
	search: search,
	data: data
});

var popover = Ti.UI.iPad.createPopover({});
popover.add(table);

button1.addEventListener('click', function(){
	popover.show({view: button1});
	// comment previous line and uncomment next two lines to see an ugly but correctly functioning table+search
	//table.top = 40; //iOS7
	//win.add(table);
	});

win.open();

Attachments

FileDateSize
sample_project.zip2014-02-14T22:02:01.000+00002553902
scr_shot1.png2014-02-14T22:02:01.000+000096779
scr_shot2.png2014-02-14T22:02:01.000+0000104072
scr_shot3.png2014-02-14T22:02:01.000+000062982
Titanium Popover TableView SearchBar issue.png2013-10-17T08:40:09.000+000043517

Comments

  1. Vishal Duggal 2014-03-04

    Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/5419
  2. Vishal Duggal 2014-03-11

    Backport to 3_2_X https://github.com/appcelerator/titanium_mobile/pull/5455
  3. Olga Romero 2014-03-12

    Tested and verified the fix with Appcelerator Studio, build: 3.2.1.201402061120 Titanium SDK, build: 3.2.3.v20140312130857 Device: iPad Air iOS version 7.1

JSON Source