@@ -56,27 +56,22 @@ export default class Row extends Component {
56
56
} ,
57
57
58
58
onPanResponderGrant : ( e , gestureState ) => {
59
- e . persist ( ) ;
60
- if ( ! this . props . manuallyActivateRows ) {
61
- this . _longPressTimer = setTimeout ( ( ) => {
62
- this . _target = e . nativeEvent . target ;
63
- this . _prevGestureState = {
64
- ...gestureState ,
65
- moveX : gestureState . x0 ,
66
- moveY : gestureState . y0 ,
67
- } ;
68
- if ( ! this . _active ) {
69
- this . _toggleActive ( e , gestureState ) ;
70
- }
71
- } , this . props . activationTime ) ;
72
- } else {
73
- this . _target = e . nativeEvent . target ;
74
- this . _prevGestureState = {
75
- ...gestureState ,
76
- moveX : gestureState . x0 ,
77
- moveY : gestureState . y0 ,
78
- } ;
79
- }
59
+ e . persist ( ) ;
60
+
61
+ this . _target = e . nativeEvent . target ;
62
+ this . _prevGestureState = {
63
+ ...gestureState ,
64
+ moveX : gestureState . x0 ,
65
+ moveY : gestureState . y0 ,
66
+ } ;
67
+
68
+ if ( this . props . manuallyActivateRows ) return ;
69
+
70
+ this . _longPressTimer = setTimeout ( ( ) => {
71
+ if ( this . _active ) return ;
72
+
73
+ this . _toggleActive ( e , gestureState ) ;
74
+ } , this . props . activationTime ) ;
80
75
} ,
81
76
82
77
onPanResponderMove : ( e , gestureState ) => {
@@ -173,7 +168,12 @@ export default class Row extends Component {
173
168
{ ...this . _panResponder . panHandlers }
174
169
style = { rowStyle }
175
170
onLayout = { this . _onLayout } >
176
- { this . props . manuallyActivateRows && children ? cloneElement ( children , { toggleRowActive : this . _toggleActive . bind ( this ) } ) : children }
171
+ { this . props . manuallyActivateRows && children
172
+ ? cloneElement ( children , {
173
+ toggleRowActive : this . _toggleActive ,
174
+ } )
175
+ : children
176
+ }
177
177
</ Animated . View >
178
178
) ;
179
179
}
@@ -198,15 +198,15 @@ export default class Row extends Component {
198
198
}
199
199
}
200
200
201
- _toggleActive ( e , gestureState ) {
201
+ _toggleActive = ( e , gestureState ) => {
202
202
const callback = this . _active ? this . props . onRelease : this . props . onActivate ;
203
203
204
204
this . _active = ! this . _active ;
205
205
206
206
if ( callback ) {
207
207
callback ( e , gestureState , this . _location ) ;
208
208
}
209
- }
209
+ } ;
210
210
211
211
_mapGestureToMove ( prevGestureState , gestureState ) {
212
212
return this . props . horizontal
0 commit comments