File tree Expand file tree Collapse file tree 8 files changed +27
-17
lines changed Expand file tree Collapse file tree 8 files changed +27
-17
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,6 @@ export default class FlingGestureHandler extends GestureHandler {
30
30
public updateGestureConfig ( { enabled = true , ...props } : Config ) : void {
31
31
super . updateGestureConfig ( { enabled : enabled , ...props } ) ;
32
32
33
- this . enabled = enabled ;
34
-
35
33
if ( this . config . direction ) {
36
34
this . direction = this . config . direction ;
37
35
}
Original file line number Diff line number Diff line change @@ -322,6 +322,18 @@ export default abstract class GestureHandler {
322
322
}
323
323
}
324
324
protected onPointerOut ( event : AdaptedEvent ) : void {
325
+ if ( this . shouldCancellWhenOutside ) {
326
+ switch ( this . currentState ) {
327
+ case State . ACTIVE :
328
+ this . cancel ( ) ;
329
+ break ;
330
+ case State . BEGAN :
331
+ this . fail ( ) ;
332
+ break ;
333
+ }
334
+ return ;
335
+ }
336
+
325
337
if ( this . config . needsPointerData ) {
326
338
this . sendTouchEvent ( event ) ;
327
339
}
@@ -573,6 +585,11 @@ export default abstract class GestureHandler {
573
585
public updateGestureConfig ( { enabled = true , ...props } : Config ) : void {
574
586
this . config = { enabled : enabled , ...props } ;
575
587
this . enabled = enabled ;
588
+
589
+ if ( this . config . shouldCancelWhenOutside !== undefined ) {
590
+ this . setShouldCancelWhenOutside ( this . config . shouldCancelWhenOutside ) ;
591
+ }
592
+
576
593
this . validateHitSlops ( ) ;
577
594
578
595
if ( this . enabled ) {
Original file line number Diff line number Diff line change @@ -42,8 +42,6 @@ export default class LongPressGestureHandler extends GestureHandler {
42
42
public updateGestureConfig ( { enabled = true , ...props } : Config ) : void {
43
43
super . updateGestureConfig ( { enabled : enabled , ...props } ) ;
44
44
45
- this . enabled = enabled ;
46
-
47
45
if ( this . config . minDurationMs !== undefined ) {
48
46
this . minDurationMs = this . config . minDurationMs ;
49
47
}
Original file line number Diff line number Diff line change 1
- import { AdaptedEvent } from '../interfaces' ;
1
+ import { AdaptedEvent , Config } from '../interfaces' ;
2
2
import GestureHandler from './GestureHandler' ;
3
3
4
4
export default class ManualGestureHandler extends GestureHandler {
5
5
public init ( ref : number , propsRef : React . RefObject < unknown > ) {
6
6
super . init ( ref , propsRef ) ;
7
7
}
8
8
9
+ public updateGestureConfig ( { enabled = true , ...props } : Config ) : void {
10
+ super . updateGestureConfig ( { enabled : enabled , ...props } ) ;
11
+ }
12
+
9
13
protected onPointerDown ( event : AdaptedEvent ) : void {
10
14
this . tracker . addToTracker ( event ) ;
11
15
super . onPointerDown ( event ) ;
@@ -22,6 +26,11 @@ export default class ManualGestureHandler extends GestureHandler {
22
26
super . onPointerMove ( event ) ;
23
27
}
24
28
29
+ protected onPointerOutOfBounds ( event : AdaptedEvent ) : void {
30
+ this . tracker . track ( event ) ;
31
+ super . onPointerOutOfBounds ( event ) ;
32
+ }
33
+
25
34
protected onPointerUp ( event : AdaptedEvent ) : void {
26
35
super . onPointerUp ( event ) ;
27
36
this . tracker . removeFromTracker ( event . pointerId ) ;
Original file line number Diff line number Diff line change @@ -65,8 +65,6 @@ export default class PanGestureHandler extends GestureHandler {
65
65
super . updateGestureConfig ( { enabled : enabled , ...props } ) ;
66
66
this . checkCustomActivationCriteria ( this . customActivationProperties ) ;
67
67
68
- this . enabled = enabled ;
69
-
70
68
if ( this . config . minDist !== undefined ) {
71
69
this . minDistSq = this . config . minDist * this . config . minDist ;
72
70
} else if ( this . hasCustomActivationCriteria ) {
@@ -98,10 +96,6 @@ export default class PanGestureHandler extends GestureHandler {
98
96
this . activateAfterLongPress = this . config . activateAfterLongPress ;
99
97
}
100
98
101
- if ( this . config . shouldCancelWhenOutside !== undefined ) {
102
- this . setShouldCancelWhenOutside ( this . config . shouldCancelWhenOutside ) ;
103
- }
104
-
105
99
if ( this . config . activeOffsetXStart !== undefined ) {
106
100
this . activeOffsetXStart = this . config . activeOffsetXStart ;
107
101
Original file line number Diff line number Diff line change @@ -57,8 +57,6 @@ export default class PinchGestureHandler extends GestureHandler {
57
57
58
58
public updateGestureConfig ( { enabled = true , ...props } : Config ) : void {
59
59
super . updateGestureConfig ( { enabled : enabled , ...props } ) ;
60
-
61
- this . enabled = enabled ;
62
60
}
63
61
64
62
protected transformNativeEvent ( ) {
Original file line number Diff line number Diff line change @@ -52,8 +52,6 @@ export default class RotationGestureHandler extends GestureHandler {
52
52
53
53
public updateGestureConfig ( { enabled = true , ...props } : Config ) : void {
54
54
super . updateGestureConfig ( { enabled : enabled , ...props } ) ;
55
-
56
- this . enabled = enabled ;
57
55
}
58
56
59
57
protected transformNativeEvent ( ) {
Original file line number Diff line number Diff line change @@ -39,8 +39,6 @@ export default class TapGestureHandler extends GestureHandler {
39
39
public updateGestureConfig ( { enabled = true , ...props } : Config ) : void {
40
40
super . updateGestureConfig ( { enabled : enabled , ...props } ) ;
41
41
42
- this . enabled = enabled ;
43
-
44
42
if ( this . config . numberOfTaps !== undefined ) {
45
43
this . numberOfTaps = this . config . numberOfTaps ;
46
44
}
You can’t perform that action at this time.
0 commit comments