[TIMOB-4475] iOS: globalPoint is undefined for a click event if you add a tableView to a window
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-10-27T15:54:20.000+0000 |
Affected Version/s | Release 1.7.0 |
Fix Version/s | Sprint 2011-28, Release 1.8.0 |
Components | iOS |
Labels | n/a |
Reporter | Jon Alter |
Assignee | Blain Hamon |
Created | 2011-06-21T16:23:31.000+0000 |
Updated | 2011-10-27T15:54:20.000+0000 |
Description
e.globalPoint is undefined for a click event if a tableView has been added to a window.
This is true if you add the event listener to the window or the tableView.
Step 1: run the code below
Step 2: tap on the tableView
Step 3: in the log you will see that globalPoint is undefined
Step 4: comment out win1.add(tableView);
Step 5: run code
Step 6: tap window
Step 7: in the log globalPoint will be an [Object]
var tabGroup = Titanium.UI.createTabGroup();
var win1 = Ti.UI.createWindow({
backgroundColor:'#f00',
title:'Red'
});
win1.addEventListener('click', function(e) {
// alert(e.globalPoint.x + '\n' + e.globalPoint.y);
Ti.API.info('e.x: '+e.x+' e.y: '+e.y);
Ti.API.info('e.globalPoint: '+e.globalPoint);
});
var tab1 = Titanium.UI.createTab({
title:'Red',
window:win1
});
var win2 = Ti.UI.createWindow({
backgroundColor:'#0f0',
title:'Green'
});
win2.addEventListener('click', function(e) {
// alert(e.globalPoint.x + '\n' + e.globalPoint.y);
Ti.API.info('e.x: '+e.x+' e.y: '+e.y);
Ti.API.info('e.globalPoint: '+e.globalPoint);
});
var tab2 = Titanium.UI.createTab({
title:'Green',
window:win2
});
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
//TABLE VIEW
var data = [];
for (var i = 0; i < 10; i++) {
data.push({title: 'Row '+i});
}
var tableView = Ti.UI.createTableView({
data:data
});
win1.add(tableView);
tabGroup.open();
Coordinate Android team implementation.
Tested with 1.8.0.v20110819142548 iPhone 4.3.4 iPad2 4.3.2