react-native-picker-select
Advanced tools
Comparing version 5.1.1 to 5.2.0
@@ -0,1 +1,7 @@ | ||
### v5.2.0 | ||
##### New | ||
- Added `onOpen` and `onClose` callbacks (iOS only) | ||
### v5.1.1 | ||
@@ -2,0 +8,0 @@ |
@@ -27,2 +27,4 @@ /// <reference types="react" /> | ||
onDownArrow?: () => void; | ||
onOpen?: () => void; | ||
onClose?: () => void; | ||
modalProps?: object; | ||
@@ -29,0 +31,0 @@ textInputProps?: object; |
{ | ||
"name": "react-native-picker-select", | ||
"version": "5.1.1", | ||
"version": "5.2.0", | ||
"description": "A Picker component for React Native which emulates the native <select> interfaces for each platform", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -53,2 +53,3 @@ # react-native-picker-select | ||
| onDonePress | function | Callback when the 'Done' button is pressed | N | iOS | | ||
| onOpen / onClose | function | Callback triggered right before the opening or closing of the picker | N | iOS | | ||
| modalProps | object | Additional props to pass to the Modal (some props are used in core functionality so use this carefully) | N | iOS | | ||
@@ -55,0 +56,0 @@ | textInputProps | object | Additional props to pass to the TextInput (some props are used in core functionality so use this carefully) | N | iOS | |
@@ -49,2 +49,4 @@ import React, { PureComponent } from 'react'; | ||
onDownArrow: PropTypes.func, | ||
onOpen: PropTypes.func, | ||
onClose: PropTypes.func, | ||
@@ -80,2 +82,4 @@ // Modal props (iOS only) | ||
onDownArrow: null, | ||
onOpen: null, | ||
onClose: null, | ||
modalProps: {}, | ||
@@ -205,2 +209,14 @@ textInputProps: {}, | ||
triggerOpenCloseCallbacks() { | ||
const { onOpen, onClose } = this.props; | ||
if (!this.state.showPicker && onOpen) { | ||
onOpen(); | ||
} | ||
if (this.state.showPicker && onClose) { | ||
onClose(); | ||
} | ||
} | ||
togglePicker(animate = false) { | ||
@@ -216,2 +232,4 @@ const { modalProps, disabled } = this.props; | ||
this.triggerOpenCloseCallbacks(); | ||
this.setState({ | ||
@@ -218,0 +236,0 @@ animationType: animate ? animationType : undefined, |
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
32964
523
80