File tree Expand file tree Collapse file tree
packages/react-native-gesture-handler/src/web Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -362,7 +362,9 @@ export default abstract class GestureHandler implements IGestureHandler {
362362 protected onPointerCancel ( _event : AdaptedEvent ) : void {
363363 // No need to send a cancel touch event explicitly here. `cancel` will
364364 // handle cancelling all tracked touches if the handler expects pointer data.
365- this . cancel ( ) ;
365+ if ( GestureHandlerOrchestrator . instance . isHandlerRecorded ( this ) ) {
366+ this . cancel ( ) ;
367+ }
366368 }
367369 protected onPointerOutOfBounds ( event : AdaptedEvent ) : void {
368370 this . tryToSendMoveEvent ( true , event ) ;
Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ export default class GestureHandlerOrchestrator {
3232 handler . activationIndex = Number . MAX_VALUE ;
3333 }
3434
35+ public isHandlerRecorded ( handler : IGestureHandler ) : boolean {
36+ return this . gestureHandlers . includes ( handler ) ;
37+ }
38+
3539 public removeHandlerFromOrchestrator ( handler : IGestureHandler ) : void {
3640 const indexInGestureHandlers = this . gestureHandlers . indexOf ( handler ) ;
3741 const indexInAwaitingHandlers = this . awaitingHandlers . indexOf ( handler ) ;
You can’t perform that action at this time.
0 commit comments