[TIMOB-14888] iOS: TableView touchmove only fires once when dragging views in a TableViewRow
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-09-20T21:14:10.000+0000 |
Affected Version/s | Release 3.1.1, Release 3.2.0 |
Fix Version/s | 2013 Sprint 19, 2013 Sprint 19 API, Release 3.1.4, Release 3.2.0 |
Components | iOS |
Labels | regression |
Reporter | Neil Gupta |
Assignee | Vishal Duggal |
Created | 2013-08-10T03:16:23.000+0000 |
Updated | 2013-10-29T18:14:13.000+0000 |
Description
*Problem*
With Titanium SDK 3.1.1, the touchmove event is only fired once and then stops once it tries to animate the view being touched. In 3.1.0, the touchmove event is fired repeatedly as expected, so the problem was introduced in 3.1.1.
*Steps to reproduce*
Add a view inside of a TableViewRow and add a touchmove event listener with an animation.
*Test case*
var win1 = Ti.UI.createWindow({
backgroundColor : "#FFF"
});
var tableview = Ti.UI.createTableView();
var tableviewrow = Ti.UI.createTableViewRow({
selectionStyle:Titanium.UI.iPhone.TableViewCellSelectionStyle.NONE
});
var view = Ti.UI.createView({
backgroundColor : '#ff0',
borderColor:'red',
borderWidth:2
});
tableviewrow.add(view);
view.addEventListener('touchstart', function() {
Ti.API.info("####### touchstart");
});
view.addEventListener('touchmove', function(e) {
Ti.API.info("touch moved!");
//view.right = e.x;
view.animate({
right : e.x,
duration : 20
});
});
view.addEventListener('touchend', function() {
Ti.API.info("####### touch ended");
view.right = 0;
});
view.addEventListener('touchcancel', function() {
Ti.API.info("####### touch canceled");
view.right = 0;
});
tableview.setData([tableviewrow]);
win1.add(tableview);
win1.open();
Attachments
File | Date | Size |
---|---|---|
app.js | 2013-09-18T20:35:10.000+0000 | 14935 |
Hi Neil, Please can you provide a simple reproducible test case that we can drop into an app.js and run? Thanks!
Added a reproducible test case of the bug. I realized that the problem is actually related to views that are animating in the touchmove event (such as when creating a swipe to clear todo list app) (This code sample also exhibits another bug where the background color of a view disappears when selected in a tableviewrow, but I'm pretty sure I already saw that filed as another ticket.)
Thanks Neil. Tested and confirmed regression on iOS 6 simulator between 3.1.0 GA and 3.1.1 GA, still occurs on 3.2 CI. About the background color disappearing - on first glance of the bug list I can't see something that describes it, would be great if you could post what you think might be a related ticket. But I'm sure engineering will take a look when they test it anyway. Thanks again.
app.js - Test case with related tickets
Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/4713
Backport to 3_1_X https://github.com/appcelerator/titanium_mobile/pull/4722
Closing ticket as fixed. Verified "touchmove" event gets fired more than once when the View is added to a TableViewRow. Tested on: Titanium Studio, build: 3.2.0.201310181940 OS: Mac OS X Mountain Lion (10.8.5) SDK build: 3.2.0.v20131018154951 Ti CLI: 3.2.0 (72f7426b4ee6c2d2883c666d5b7e03906a16012f) Devices: iphone 4s (6.0.1), iphone 5 (7.0.2)