[TIMOB-5394] 1.8 Breaks tableView click events in some circumstances
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-10-07T11:23:52.000+0000 |
Affected Version/s | Release 1.8.0 |
Fix Version/s | Sprint 2011-40, Release 1.8.0 |
Components | iOS |
Labels | module_tableview, qe-testadded |
Reporter | Rick Blalock |
Assignee | Blain Hamon |
Created | 2011-09-30T10:58:02.000+0000 |
Updated | 2014-06-19T12:46:38.000+0000 |
Description
TableView click events don't work depending on how complex the rows are. Previous to the build referenced it worked fine (and also works in 1.7.2). Below is a sample to reliably reproduce.
var createBGBox = function(view, height) {
height = height || 40;
var outerView = Ti.UI.createView({
width: 'auto',
height: view.size.height + height
});
var contentView = view;
outerView.content = contentView;
var defaults = {
backgroundColor: "#e4e4e4", //"#c9d9df",
opacity: 0.90,
borderRadius: 7,
borderWidth: 1,
borderColor: "#FFFFFF",
left: 5,
width: 310,
height: view.size.height + (height - 10)
};
var bgView = Ti.UI.createView(defaults);
var ds = Ti.UI.createImageView({
image: 'KS_nav_ui.png',
hires: true,
top: bgView.size.height - 12,
width: 320,
left: 0
});
outerView.add(ds);
outerView.add(bgView);
outerView.add(contentView);
return outerView;
};
var createCustomTableRow = function(obj) {
var row = Ti.UI.createTableViewRow({
className: 'eventdata',
hasChild: true,
height: 99,
borderWidth:0,
selectedBackgroundImage: 'none',
selectionStyle:Ti.UI.iPhone.TableViewCellSelectionStyle.NONE
});
var txtView = Ti.UI.createView({
layout: 'vertical',
width: 'auto',
height: 'auto',
left: 115
});
var contentView = Ti.UI.createView({
width: 'auto',
height: 'auto'
});
var titleLBL = Ti.UI.createLabel({
text: obj.name,
height: 'auto',
width: 170,
left: 5,
font: {
fontSize: 15,
fontWeight: 'bold'
}
});
txtView.add(titleLBL);
contentView.add(txtView);
var view = createBGBox(contentView);
row.add(view);
row.height = view.size.height;
return row;
};
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
var data = [
createCustomTableRow({
name: 'Test Row Data'
}),
createCustomTableRow({
name: 'Test Row Data'
}),
createCustomTableRow({
name: 'Test Row Data'
}),
createCustomTableRow({
name: 'Test Row Data'
}),
createCustomTableRow({
name: 'Test Row Data'
}),
createCustomTableRow({
name: 'Test Row Data'
})
];
var table = Ti.UI.createTableView({
separatorStyle: Ti.UI.iPhone.TableViewSeparatorStyle.NONE,
backgroundColor: 'transparent',
top:'7%',
data: data
});
table.addEventListener('click', function() {
alert('row clicked');
})
win.add(table);
win.open();
Pull pending
Regression test: The following should not have any scrolling or response from the web view other than alerts on singletap and swipe.
ipad2 5.0.1 RC1, studio 1.0.7RC, 10.6.8