Famous / Famous/engine

GestureHandler does not trigger "end" events for "tap" gestures

Open
#168 5 comments 0 reactions 0 assignees View on GitHub
enhancement feature request question
Dominant language
JavaScript
Stars
1.7k
Forks
249
PR merge metrics
No merged PRs in 30d

Description

`GestureHandler` currently triggers only `start` events for `tap` gestures.

The source code tells me this was intended behavior by design, but wouldn't it be more consistent with other gesture types to trigger an `end` event (or at least provide an option to subscribe this event status)? Any of these events on receive can terminate the `tap` event being tracked: `touchmove`, `mousemove`, `touchend`, `mouseup`, and `mouseleave`.

Besides consistency, it would allow handling long press (touch & hold) gestures. We can also only react to `end` events, similar to `onTouchEnd`/`onMouseUp`.

If the original intention behind triggering only `start` events was for simplicity in event handling, we can probably add a filtering option to `.on()` while triggering both `start` and `end` by default. (ex: `.on('tap', ['start'], cb)` or `.on('tap:start', cb)`)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.