react-native-gesture-handler
react-native-gesture-handler copied to clipboard
Add functionality to track subsequent taps
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
maxNumberOfTapsproperty to the Tap Gesture Handler configuration - Added support for unlimited taps by allowing
Math.Infinityas 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