Skip to content

Commit

Permalink
fix: handle failed gesture state to clear interaction (#11465)
Browse files Browse the repository at this point in the history
Added failed gesture state to clear interaction manager queue 

**Motivation**

My team ran into an issue on IOS where the user taps somewhere on the
left edge of the screen without any swipe, and upon releasing their
finger, the InteractionManager has one outstanding task in the queue.
And this task can block user interactions wrapped into
`InteractionManager.runAfterInteractions`

It could be related with
#8606 but i'm
not sure

**Test plan**

1. Create a stack with two screen with an ability to navigate by swipe
2. Navigate from screen (1) to screen (2)
3. Tap somewhere in the left edge of the screen
4. After that all actions wrapped into
`InteractionManager.runAfterInteractions` will not work

---------

Co-authored-by: viktoriltimirov <viktor.iltimirov@sbermarket.ru>
Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
  • Loading branch information
3 people committed Feb 8, 2024
1 parent 4c521b5 commit 1b56cb5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/stack/src/views/Stack/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ export class Card extends React.Component<Props> {
this.handleStartInteraction();
onGestureBegin?.();
break;
case GestureState.CANCELLED: {
case GestureState.CANCELLED:
case GestureState.FAILED: {
this.isSwiping.setValue(FALSE);
this.handleEndInteraction();

Expand Down

0 comments on commit 1b56cb5

Please sign in to comment.