File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Libraries/Experimental/SwipeableRow Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ const SwipeableRow = React.createClass({
166166 gestureState : Object ,
167167 ) : boolean {
168168 // Decides whether a swipe is responded to by this component or its child
169- return gestureState . dy < 10 && this . _isValidSwipe ( gestureState ) ;
169+ return gestureState . dy < 10 && this . _isValidSwipe ( gestureState ) ;
170170 } ,
171171
172172 _handlePanResponderGrant ( event : Object , gestureState : Object ) : void {
@@ -175,7 +175,14 @@ const SwipeableRow = React.createClass({
175175
176176 _handlePanResponderMove ( event : Object , gestureState : Object ) : void {
177177 this . props . onSwipeStart ( ) ;
178- this . state . currentLeft . setValue ( this . _previousLeft + gestureState . dx ) ;
178+
179+ if ( ! this . _isSwipingRightFromClosedPosition ( gestureState ) ) {
180+ this . state . currentLeft . setValue ( this . _previousLeft + gestureState . dx ) ;
181+ }
182+ } ,
183+
184+ _isSwipingRightFromClosedPosition ( gestureState : Object ) : boolean {
185+ return this . _previousLeft === CLOSED_LEFT_POSITION && gestureState . dx > 0 ;
179186 } ,
180187
181188 _onPanResponderTerminationRequest ( event : Object , gestureState : Object ) : boolean {
You can’t perform that action at this time.
0 commit comments