react-native-modal
Advanced tools
Comparing version 5.1.0 to 5.1.1
{ | ||
"name": "react-native-modal", | ||
"version": "5.1.0", | ||
"version": "5.1.1", | ||
"description": "An enhanced React-Native modal", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -178,3 +178,3 @@ import React, { Component } from "react"; | ||
const newOpacityFactor = 1 - accDistance / this.state.deviceWidth; | ||
if (this.isSwipeDirectionAllowed(gestureState)) { | ||
if (this.isSwipeDirectionAllowed(gestureState) && this.backdropRef) { | ||
this.backdropRef.transitionTo({ | ||
@@ -197,6 +197,8 @@ opacity: this.props.backdropOpacity * newOpacityFactor | ||
//Reset backdrop opacity and modal position | ||
this.backdropRef.transitionTo( | ||
{ opacity: this.props.backdropOpacity }, | ||
this.props.backdropTransitionInTiming | ||
); | ||
if (this.backdropRef) { | ||
this.backdropRef.transitionTo( | ||
{ opacity: this.props.backdropOpacity }, | ||
this.props.backdropTransitionInTiming | ||
); | ||
} | ||
Animated.spring(this.state.pan, { | ||
@@ -279,7 +281,10 @@ toValue: { x: 0, y: 0 }, | ||
this.transitionLock = true; | ||
this.backdropRef.transitionTo( | ||
{ opacity: this.props.backdropOpacity }, | ||
this.props.backdropTransitionInTiming | ||
); | ||
if (this.backdropRef) { | ||
this.backdropRef.transitionTo( | ||
{ opacity: this.props.backdropOpacity }, | ||
this.props.backdropTransitionInTiming | ||
); | ||
} | ||
// This is for reset the pan position, if not modal get stuck | ||
@@ -305,6 +310,8 @@ // at the last release position when you try to open it. | ||
this.transitionLock = true; | ||
this.backdropRef.transitionTo( | ||
{ opacity: 0 }, | ||
this.props.backdropTransitionOutTiming | ||
); | ||
if (this.backdropRef) { | ||
this.backdropRef.transitionTo( | ||
{ opacity: 0 }, | ||
this.props.backdropTransitionOutTiming | ||
); | ||
} | ||
@@ -311,0 +318,0 @@ let animationOut = this.animationOut; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28470
462