react-native-date-picker
Advanced tools
Comparing version 4.1.3 to 4.1.4
{ | ||
"name": "react-native-date-picker", | ||
"version": "4.1.3", | ||
"version": "4.1.4", | ||
"description": "A datetime picker for React Native. In-modal or inlined. Supports Android and iOS.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -21,4 +21,7 @@ import React from 'react' | ||
const props = this.getProps() | ||
const isClosed = this._isCurrentlyClosed(); | ||
this.previousProps = props; | ||
if (props.modal) { | ||
if (props.open) { | ||
if (props.open && isClosed) { | ||
NativeModules.RNDatePicker.openPicker( | ||
@@ -36,2 +39,4 @@ props, | ||
_isCurrentlyClosed = () => !this.previousProps || !this.previousProps.open | ||
getProps = () => ({ | ||
@@ -38,0 +43,0 @@ ...this.props, |
@@ -48,5 +48,7 @@ import React, { useEffect } from 'react' | ||
const props = this._toIosProps(this.props) | ||
const isClosed = this._isCurrentlyClosed(); | ||
this.previousProps = props; | ||
if (props.modal) { | ||
if (props.open) { | ||
if (props.open && isClosed) { | ||
NativeModules.RNDatePickerManager.openPicker( | ||
@@ -74,2 +76,4 @@ props, | ||
} | ||
_isCurrentlyClosed = () => !this.previousProps || !this.previousProps.open | ||
} | ||
@@ -76,0 +80,0 @@ |
178678
582