React-native-modal-datetime-picker: IOS - Cannot reopen modal

Created on 29 Apr 2019  路  1Comment  路  Source: mmazzarolo/react-native-modal-datetime-picker

When I close the DateTimePicker using "false" state, I cannot seems to reopen the modal again using "true" state.

When reporting a bug, please be sure to check if the issue still persists with react-native original date/time pickers:

Under the hood react-native-modal-datetime-picker uses react-native original DatePickerAndroid, TimePickerAndroid and DatePickerIOS.
Before reporting a bug, try swapping react-native-datetime-picker with react-native original date/time pickers to check if the problem persists.

When reporting a bug, please be sure to include the following:

  • [ ] The outcome of the react-native-modal-datetime-picker swap described above
  • [ ] A descriptive title
  • [ ] An isolated way to reproduce the behavior (example: GitHub repository with code isolated to the issue that anyone can clone to observe the problem)
  • [ ] What version of react-native-modal-datetime-picker you're using, and the platform(s) you're running it on (iOS, Android, device)
  • [ ] What packages or other dependencies you're using
  • [ ] The behavior you expect to see, and the actual behavior

When you open an issue for a feature request, please add as much detail as possible:

  • [ ] A descriptive title
  • [ ] A description of the problem you're trying to solve, including why you think this is a problem
  • [ ] An overview of the suggested solution
  • [ ] If the feature changes current behavior, reasons why your solution is better

Please note by far the quickest way to get a new feature is to file a Pull Request.

invalid

Most helpful comment

I know this is closed, but I want to give a solution for those still having the issue. You need to set the value of your visibility variable to false whenever onConfirm is invoked.

Ex:

<DateTimePicker 
     isVisible={this.state.visible}
     onCancel={() => this.setState({ visible: false })
     onConfirm={(date) => {
          // handle date
          this.setState({ visible: false });
     }}
/>

>All comments

I know this is closed, but I want to give a solution for those still having the issue. You need to set the value of your visibility variable to false whenever onConfirm is invoked.

Ex:

<DateTimePicker 
     isVisible={this.state.visible}
     onCancel={() => this.setState({ visible: false })
     onConfirm={(date) => {
          // handle date
          this.setState({ visible: false });
     }}
/>
Was this page helpful?
0 / 5 - 0 ratings