BUG?: canceling swipe-to-delete returns faulty click event
Canceling a swipe-to-delete fires click event without correct information. Is there a formal value to look for to "ignore" this click? I'm catching this by checking that e.rowData is defined, but suspect there should be something else to test.
You can reproduce this in Kitchen Sink:
Views > Table Views > Delete Mode (2)
First alert (after canceling swipe-to-delete) is full of undefined values for a table view click. Next click is normal.
4 Answers
-
im having the same problem.
my table has a click event that gets fired when canceling the delete.
any ideas how to fix it? im trying a conditional statement with the editable property but nothing yet. -
Tableview and tableviewrows apparently do not support swipe, click and some other events consistently. I also haven't found a workaround either.
-
I have this problem as well. I've tried catching this with a "swipe" and a "click" event listener, but it doesn't seem to be working. It's very annoying because then it is opening a page with null values and causing some big problems in development.
-
I just dealt with this in my app. This is how I solved it (in my click event listener):
var source = e.source + ""; // need source as string if (source.indexOf('TiUITableViewRow') >0) { // do stuff here }
When the delete is canceled, the click event source is TiUITableView rather than the row, so I ignore any click event that isn't on the row. If you have custom rows, you'll need to add the other objects in here to detect clicks, like TiUILabel.