Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25979] Android: Changing index break events on TableViewRow

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-08-24T01:39:43.000+0000
Affected Version/sRelease 7.1.0
Fix Version/sRelease 7.5.0
ComponentsAndroid
Labelsandroid, tableviewrow
ReporterCREATIVE KAIZEN
AssigneeYordan Banev
Created2018-04-20T16:21:43.000+0000
Updated2018-09-10T10:06:11.000+0000

Description

When we populate TableView with TableViewRows and then change their order with updateRow method it will prevent firing events on the TableViewRow with lowest index. This includes click and touchstart events. Code to reproduce:
var window = Ti.UI.createWindow();
window.open();


var container = Ti.UI.createView({	
	backgroundColor: '#333'
});

	var tableView = Ti.UI.createTableView({
		backgroundColor: 'white'
	});
	
	var row1 = Ti.UI.createTableViewRow({
		height: 50,
		backgroundColor: 'red',
		className: 'scheduled'
	});
	
	var row2 = Ti.UI.createTableViewRow({
		height: 50,
		backgroundColor: 'green',
		className: 'scheduled'
	});
	
	
	var row3 = Ti.UI.createTableViewRow({
		height: 50,
		backgroundColor: 'yellow',
		className: 'scheduled'
	});
	
	
	
	tableView.appendRow(row1);
	tableView.appendRow(row2);
	tableView.appendRow(row3);
	
	tableView.updateRow(0, row3); //this row will stop to react on events
	tableView.updateRow(1, row2);
	tableView.updateRow(2, row1);
	
	container.add(tableView);


window.add(container);
	
tableView.addEventListener('click', function() {alert('clickFromTableView');});
container.addEventListener('click', function() {alert('clickFromContainer');});

Comments

  1. Yordan Banev 2018-06-20

    PR: https://github.com/appcelerator/titanium_mobile/pull/10124
  2. Samir Mohammed 2018-07-18

    *Closing ticket*, Verified fix in SDK Version: 7.4.0.v20180717131401 Index no longer breaks on the lowest index when changing the order (Tested with the code in the description). *Test Environment*
       APPC Studio: 5.0.0.201712081732
       APPC CLI: 7.0.4
       Nexus 6p Emulator (8.0)
       Operating System Name: Mac OS High Sierra
       Operating System Version: 10.13
       Node.js Version: 8.9.1
       Xcode 9.2
       
  3. Samir Mohammed 2018-09-10

    *Closing ticket.* Also verified using SDK Version 7.5.0.v20180906093938

JSON Source