react-native-modal
Advanced tools
Comparing version 3.0.1 to 3.0.2
{ | ||
"name": "react-native-modal", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "An enhanced React-Native modal", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -75,3 +75,2 @@ # react-native-modal | ||
| backdropTransitionOutTiming | number | 300 | The backdrop hide timing (in ms) | | ||
| hideOnBack | bool | true | Hide the modal on back button press? | | ||
| onBackButtonPress | func | () => null | Called when the Android back button is pressed | | ||
@@ -78,0 +77,0 @@ | onBackdropPress | func | () => null | Called when the backdrop is pressed | |
@@ -26,4 +26,2 @@ import React, { Component } from 'react'; | ||
onModalHide: PropTypes.func, | ||
hideOnBack: PropTypes.bool, | ||
hideOnBackdropPress: PropTypes.bool, | ||
onBackButtonPress: PropTypes.func, | ||
@@ -46,4 +44,2 @@ onBackdropPress: PropTypes.func, | ||
isVisible: false, | ||
hideOnBack: false, | ||
hideOnBackdropPress: false, | ||
onBackdropPress: () => null, | ||
@@ -120,17 +116,2 @@ onBackButtonPress: () => null, | ||
_closeOnBack = () => { | ||
if (this.props.hideOnBack) { | ||
this._close(); | ||
} | ||
this.props.onBackButtonPress(); | ||
}; | ||
_closeOnBackdrop = () => { | ||
if (this.props.hideOnBackdropPress) { | ||
this._close(); | ||
} | ||
this.props.onBackdropPress(); | ||
}; | ||
render() { | ||
@@ -149,3 +130,4 @@ const { | ||
onModalShow, | ||
onModalHide, | ||
onBackdropPress, | ||
onBackButtonPress, | ||
style, | ||
@@ -160,6 +142,6 @@ ...otherProps | ||
visible={this.state.isVisible} | ||
onRequestClose={this._closeOnBack} | ||
onRequestClose={onBackButtonPress} | ||
{...otherProps} | ||
> | ||
<TouchableWithoutFeedback onPress={this._closeOnBackdrop}> | ||
<TouchableWithoutFeedback onPress={onBackdropPress}> | ||
<View | ||
@@ -166,0 +148,0 @@ ref={ref => (this.backdropRef = ref)} |
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
14925
230
89