react-native-date-picker icon indicating copy to clipboard operation
react-native-date-picker copied to clipboard

Date and time picker is not working properly in Android using version 4.3.3

Open Udayan-KS opened this issue 1 year ago • 5 comments

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:

  • OS: Android
  • React Native version 0.72.5
  • react-native-date-picker version 4.3.3

Udayan-KS avatar Oct 06 '23 07:10 Udayan-KS

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.

erikahendsel avatar Oct 17 '23 14:10 erikahendsel

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

Danyal255 avatar Nov 22 '23 07:11 Danyal255

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.

Elolawyn avatar Dec 19 '23 08:12 Elolawyn

[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

Jxy1230 avatar Apr 22 '24 08:04 Jxy1230

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

Knorway avatar Jul 29 '24 09:07 Knorway