Skip to content

Commit 703fd3a

Browse files
authored
Fix ripple effect staying after cancellation (#2586)
## Description Sometimes when our `Button` (like `BaseButton`) is cancelled, it gets stuck at ripple animation. This may also prevent other components form receiving events, until the button will be pressed again (which will release it). This PR changes behavior after receiving `ACTION_CANCEL`, so that buttons don't get stuck anymore. Fixes #2585 ## Test plan Tested on example from [issue](#2585) and `NestedButtons` example from our example app.
1 parent 8c41b09 commit 703fd3a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ class RNGestureHandlerButtonViewManager : ViewGroupManager<ButtonViewGroup>(), R
174174
override fun onTouchEvent(event: MotionEvent): Boolean {
175175
if (event.action == MotionEvent.ACTION_CANCEL) {
176176
tryFreeingResponder()
177+
return super.onTouchEvent(event)
177178
}
178179

179180
val eventTime = event.eventTime

0 commit comments

Comments
 (0)