Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
UdayanTV opened this issue Oct 6, 2023 · 4 comments

Comments

@UdayanTV
Copy link

UdayanTV commented Oct 6, 2023

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
@erikahendsel
Copy link

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.

@Danyal255
Copy link

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

@Elolawyn
Copy link

Elolawyn commented Dec 19, 2023

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.

@Jxy1230
Copy link

Jxy1230 commented Apr 22, 2024

[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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants