question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Date picker open twice, hence need to be confirmed twice on Android.

See original GitHub issue

Bug

   const currentDate = selectedDate || date;

   setDate(currentDate);
   setShow(Platform.OS === 'ios' ? true : false);
 };

this piece of code show as an example on homepage readme file will produce the date picker, but on android, the picker will be opened twice, hence need to be confirmed twice on Android.

fix

move setShow(Platform.OS === 'ios' ? true : false); to second line, right after currentDate declaration fixes issue on my end. Also ? true : false is redundant.

suggestion

modify the example code on readme file.

ReactNative version 0.61, expo version 36.0.0, datetimepicker version 2.1.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
tz925commented, Mar 3, 2020

@tz925 would you like to open a PR to fix this?

Sure I will do a PR.

0reactions
tsleolimacommented, Jan 20, 2021

thanks man 😄 ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Date picker open twice, hence need to be confirmed ... - GitHub
this piece of code show as an example on homepage readme file will produce the date picker, but on android, the picker will...
Read more >
DatePicker.OnDateChangedListener called twice
When I test my application, method onDateSet called twice after accept the date selection and once when I canceled. I added a validation...
Read more >
Timepicker opening twice once datepicker has been used
I'm using a time and date picker for the user to choose when they want a reminder to come through to their phone....
Read more >
react-native-modal-datetime-picker-with-android-onclose - Snyk
I can't set the initial date on the picker. Please make sure you're using the date props (and not the value one). The...
Read more >
Anker 337 Power Bank (PowerCore 26K) Portable Charger ...
Anker 337 Power Bank (PowerCore 26K) Portable Charger, 26800mAh External Battery with Dual Input Port and Double-Speed Recharging, 3 USB Ports for iPhone,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found