Date picker open twice, hence need to be confirmed twice on Android.
See original GitHub issueBug
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:
- Created 4 years ago
- Reactions:9
- Comments:6 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure I will do a PR.
thanks man 😄 ❤️