Skip to content

Commit

Permalink
Fix ripple effect staying after cancellation (#2586)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
m-bert authored Sep 18, 2023
1 parent 8c41b09 commit 703fd3a
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ class RNGestureHandlerButtonViewManager : ViewGroupManager<ButtonViewGroup>(), R
override fun onTouchEvent(event: MotionEvent): Boolean {
if (event.action == MotionEvent.ACTION_CANCEL) {
tryFreeingResponder()
return super.onTouchEvent(event)
}

val eventTime = event.eventTime
Expand Down

0 comments on commit 703fd3a

Please sign in to comment.