Working with 1080 and not seeing this TAP support. I do not see anything in the documentation that suggests how to access this support for tap. I tried adding an onRowTap listener but that does not seem to be the ticket.
Can you let us know how to access the Tap handling on the tableview rows?
The worst problem for me, is that “tap” is triggered even if table is currently scrolling.
I try to get property “_view._velocity” but is always 0, i think it’s because the property “_view._trackVelocity” is “false”, and even if i try to change it to true, the next time event was dispatched, it’s set to “false” again.
In the scrollView that didn’t happen, the velocity and trackVelocity are working correctly. So if “_velocity” is not 0 ignore the “tap” event.
If phase = “tap” there is no event.row, just an event.target. For other phases there is an event.row which according to the docs is what we should use to reference the row.
What I’ve done temporarily at the top of my onRowTouch function is to add this:
if (event.row == nil) then event.row = event.target; end
As it was said before it’s very difficult to press a row.
I can add a “tap” listener when creating the row, but if row was taped when scroll is happening the scroll stop (as it should ) but the tap event is dispatched (and it shouldn’t), the event should only be dispatched when the table isn’t scrolling.
I arrived here because ‘event.row’ was returning ‘nil’ for the event ‘release’ for me, and I was also hoping to find some clarity on “press” vs “tap” vs “release”. From what I’ve read on this thread, “tap” looks like the most sensible event to listen for when all you’re interested in is what row the user wants to select.
So I’m guessing ‘press’ and ‘release’ are more raw events, with which one could do fancier tableview footwork? Anyone have a clearer explanation of ‘press’ vs ‘release’ vs ‘tap’? What are circumstances where one would want to listen to ‘press’ and ‘release’ but not ‘tap’?
Well, off the top of my head, I’d say that “tap” would be used when normally selecting a row.
Let’s say you’d like functionality to move rows up/down in a list. You’d listen for “press” to select the row for moving and “release” when you’ve moved it to where you want it.
The worst problem for me, is that “tap” is triggered even if table is currently scrolling.
I try to get property “_view._velocity” but is always 0, i think it’s because the property “_view._trackVelocity” is “false”, and even if i try to change it to true, the next time event was dispatched, it’s set to “false” again.
In the scrollView that didn’t happen, the velocity and trackVelocity are working correctly. So if “_velocity” is not 0 ignore the “tap” event.
If phase = “tap” there is no event.row, just an event.target. For other phases there is an event.row which according to the docs is what we should use to reference the row.
What I’ve done temporarily at the top of my onRowTouch function is to add this:
if (event.row == nil) then event.row = event.target; end
I found out that the “release” phase does not fire if you press a row, drag then release. A feature like custom row background change on press and back to the original on release is not possible, the background will remain in the pressed state if the row is dragged. It used to work in version 1.
The following code is supposed to change the alpha of the row to 0.5 on press and back to 1 on release which works fine if you press then release but not if you press then drag the row then release:
That is intentional. Look at how it works on iOS natively. If you press then drag a row, after focus is removed from it (ie it’s highlight), the release event shouldn’t fire because the row is no longer active.
As a compromise I guess a “cancelled” event could be fired for the row in question.