react-native-gesture-handler icon indicating copy to clipboard operation
react-native-gesture-handler copied to clipboard

Add functionality to track subsequent taps

Open lededje opened this issue 6 months ago • 0 comments

Description

This PR adds support for tracking multiple sequential taps in the Tap Gesture Handler by introducing a new maxNumberOfTaps property. This specific use case I was trying to cover are more discrete video interactions, such as skipping forwards or backwards in a video over and over.

Key changes:

  • Added new maxNumberOfTaps property to the Tap Gesture Handler configuration
  • Added support for unlimited taps by allowing Math.Infinity as a value

The implementation maintains the existing behavior when maxNumberOfTaps is not specified, ensuring backward compatibility with existing code.

Test plan

Tested on both iOS (iPhone 14 Pro 18.3 - Device) and Android (Pixel 9 13 API 33 - Simulator) platforms the following tap patterns

  • Single tap (default behavior)
  • Double tap with max 3 taps
  • Triple tap with unlimited taps

The changes are exclusively within typescript utilising existing features for the most part, I don't forsee too many issues

lededje avatar May 28 '25 07:05 lededje