[TIMOB-11509] iOS: Touch events not fired outside sub view in table view row
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-12-18T20:49:38.000+0000 |
Affected Version/s | Release 2.1.2, Release 2.1.3, Release 3.0.0 |
Fix Version/s | Release 3.0.1, Release 3.1.0, 2012 Sprint 26 API, 2012 Sprint 26 |
Components | iOS |
Labels | module_tableviewrow, qe-review, qe-testadded |
Reporter | Daniel Sefton |
Assignee | Sabil Rahim |
Created | 2012-10-16T22:26:46.000+0000 |
Updated | 2014-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();
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.
Fixed by PR https://github.com/appcelerator/titanium_mobile/pull/3560
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