[TIMOB-3201] Android: touchstart or touchend doesn't fire on tableview.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2012-08-31T13:57:00.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | android, defect, reported-1.6.1 |
Reporter | John Scanlon |
Assignee | Neeraj Gupta |
Created | 2011-04-15T03:39:18.000+0000 |
Updated | 2017-03-21T21:19:36.000+0000 |
Description
Problem
The "touchstart" and "touchend" events aren't firing on a table view.
Tested On
BROKEN on Titanium Mobile SDK 1.5.1, 1.5.2, 1.6.0, several 1.7.0
Sample Code
var win = Ti.UI.createWindow({ backgroundColor: '#000099' });
// create table view data object
var data = [];
data[0] = Ti.UI.createTableViewRow({title:'Row 1',backgroundColor:'#900'});
data[1] = Ti.UI.createTableViewRow({title:'Row 2',backgroundColor:'#fff'});
data[2] = Ti.UI.createTableViewRow({title:'Row 3',backgroundColor:'#900'});
data[3] = Ti.UI.createTableViewRow({title:'Row 4',backgroundColor:'#fff'});
// create table view
var tableview = Titanium.UI.createTableView({
data:data,
bottom:30,
left:20,
right:20,
height:178,
borderWidth:2,
borderRadius:10,
borderColor:'#222'
});
// create table view event listener
tableview.addEventListener('touchstart', function(e)
{
Ti.API.info('touchstart fired');
});
// create table view event listener
tableview.addEventListener('touchend', function(e)
{
Ti.API.info('touchend fired');
});
// add table view to the window
win.add(tableview);
win.open();
Workaround
I was playing around with this more and if you create a view that is the width and height of each row and add it to each tableviewrow the touchstart and touchend get fired. This isn't desireable since the properties for the tableviewrow are no longer accessable.
I'm having this issue as well. [can this be high priority? :)]
I'm using Ti Mobile 1.6.1 and Android 1.6. Using John's workaround does work!
Why is this bug marked as trivial? I would think that having events fire correctly would be a high priority as it is a basic feature of any framework.
Tested on a Samsung Galaxy S2 using TiSDK 2.2.0v20120830102513, unable to reproduce the issue. Ticket marked as resolved.
Closing ticket as the issue cannot be reproduced.