Open Udayan-KS opened 1 year ago
I would like to add, it seems to work if you wait until the date inputs are perfectly scrolled to center. If you are bit too fast to press confirm, it does not detect the changes.
I'm facing same error in android it did not work properly specially setting up the date. When I click on confirm it did not set the date and also when I try to open it next time even tho my state get true it did not open Date Picker. I have a same version react-native-date-picker version 4.3.3 but when I downgraded to 4.2.14 it work for me Thanks @UdayanTV
The same happens to me with the last version on android regarding the onConfirm. The modal opens just fine all the time.
I am using the modal android native variant with a react state = undefined as date and when onConfirm executes I assign the returned value to the date react state.
It works fine but only if I wait until the date inputs are perfectly scrolled to center just like @erikahendsel said. Downgrading to 4.2.14 did not do anything.
[react-native-date-picker/android/src/main/java/com/henninghall/date_picker/ui/WheelChangeListenerImpl.java] change before: if (minDate != null && selectedDate.before(minDate)) { uiManager.animateToDate(minDate); return; } change after: if (minDate != null && selectedDate.before(minDate)) { uiManager.animateToDate(minDate); Emitter.onDateChange(minDate, minDate.toString(), state.getId(), rootView); return; } I think will help you
it does not invoke onConfirm callback after navigating back to the screen that returns DatePicker in my case. downgrading the package from 5.0.0 to 4.2.13 solved it
Both the Date and Time picker are behaving in a weird manner in Android while using version 4.3.3. The modal will only show up once and upon selecting the confirm button, onConfirm callback is not triggered. But it's working properly in iOS. If downgraded to 4.2.14 there is no issue. The new architecture is not used in the project.
Expected behavior The modal should pop up each time the open prop flag is set to true and the confirm button should trigger onConfirm callback
Smartphone: