Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11509] iOS: Touch events not fired outside sub view in table view row

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-12-18T20:49:38.000+0000
Affected Version/sRelease 2.1.2, Release 2.1.3, Release 3.0.0
Fix Version/sRelease 3.0.1, Release 3.1.0, 2012 Sprint 26 API, 2012 Sprint 26
ComponentsiOS
Labelsmodule_tableviewrow, qe-review, qe-testadded
ReporterDaniel Sefton
AssigneeSabil Rahim
Created2012-10-16T22:26:46.000+0000
Updated2014-06-19T12:44:02.000+0000

Description

*Expected behavior* touchstart event should fire outside of sub view in table view row. *Actual behavior* touchstart event is NOT fired outside of sub view in table view row. *Note* See comment about bubbleParent. *Code*
var win = Ti.UI.createWindow();

var tableview = Titanium.UI.createTableView();

var data = [];
var row = Ti.UI.createTableViewRow();
var subview = Ti.UI.createView({
	backgroundColor:"#FF0000",
	width : "46dp",
	height: "46dp"
});
row.add(subview); // Comment out to start receiving touch events for the entire row
data.push(row);

tableview.setData(data);

tableview.addEventListener('touchstart', function(e) {
	// Not fired
	Ti.API.info("TouchStart");
});
tableview.addEventListener('touchend', function(e) {
	// Not fired
	Ti.API.info("TouchEnd");
});

win.add(tableview);
win.open();

Comments

  1. Daniel Sefton 2012-10-16

    So apparently the bubbleParent property was intended to solve this: https://github.com/appcelerator/titanium_mobile/blob/master/apidoc/Titanium/Proxy.yml However, bubbleParent is true by default, which means that touch events SHOULD BE fired outside sub view in table view row by DEFAULT, which they are not. Furthermore, if bubbleParent is set to false on the sub view, the sub view should continue to receive touch events, but it does not.
  2. Vishal Duggal 2012-12-18

    Fixed by PR https://github.com/appcelerator/titanium_mobile/pull/3560
  3. Shyam Bhadauria 2013-01-10

    Environment used for verification - Titanium SDK: 3.1.0.v20130108153753 Titanium SDK:3.0.1.v20130109180643 Titanium  Studio:3.0.1.201212181159 Device: Simulator iOS 6.0

JSON Source