Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14888] iOS: TableView touchmove only fires once when dragging views in a TableViewRow

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-09-20T21:14:10.000+0000
Affected Version/sRelease 3.1.1, Release 3.2.0
Fix Version/s2013 Sprint 19, 2013 Sprint 19 API, Release 3.1.4, Release 3.2.0
ComponentsiOS
Labelsregression
ReporterNeil Gupta
AssigneeVishal Duggal
Created2013-08-10T03:16:23.000+0000
Updated2013-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

FileDateSize
app.js2013-09-18T20:35:10.000+000014935

Comments

  1. Daniel Sefton 2013-08-12

    Hi Neil, Please can you provide a simple reproducible test case that we can drop into an app.js and run? Thanks!
  2. Neil Gupta 2013-08-13

    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.)
  3. Daniel Sefton 2013-08-15

    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.
  4. Vishal Duggal 2013-09-18

    app.js - Test case with related tickets
  5. Vishal Duggal 2013-09-18

    Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/4713
  6. Vishal Duggal 2013-09-20

    Backport to 3_1_X https://github.com/appcelerator/titanium_mobile/pull/4722
  7. Wilson Luu 2013-10-21

    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)

JSON Source