fix: image tap functionality on android #3272
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎯 Goal
On certain Android devices, tapping on images in messages requires multiple taps to work when enableSwipeToReply is enabled. The issue occurs because the pan gesture detector intercepts touch events before they can reach the image Pressable components.
🛠 Implementation details
This pull request introduces an improvement to the swipe gesture handling in the
SwipableMessageBubblecomponent. The change ensures that swipe gestures are only activated when the user's touch movement exceeds a minimum distance, which helps prevent accidental activations from small or unintended touches.Gesture handling improvements:
MINIMUM_DISTANCEthreshold (set to 8) and updated the gesture logic to require a minimum movement before activating or failing the swipe gesture, reducing false positives from minor touch movements. (package/src/components/Message/MessageSimple/MessageBubble.tsx) [1] [2]🎨 UI Changes
iOS
Android
🧪 Testing
Tested on Galaxy S22 and Iphone 16
☑️ Checklist
developbranch