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 Picker Constraint Not Enforced on 'Ok' Button Click. #2508

Open
AdityaKBhadragond14 opened this issue Apr 4, 2024 · 5 comments · May be fixed by #2514
Open

Date Picker Constraint Not Enforced on 'Ok' Button Click. #2508

AdityaKBhadragond14 opened this issue Apr 4, 2024 · 5 comments · May be fixed by #2514
Assignees
Labels
effort:small Small effort - 2 days P2 Medium priority issue ux

Comments

@AdityaKBhadragond14
Copy link

Describe the bug
In the date picker if there is some constraint which does not allow to select the current date and the user still clicks on "OK" button without selecting any date it still selects the current date as the answer as it is the default to it.

Screen_recording_20240404_153456.webm

Component
SDC Gallery app

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
There can be two approaches to solving this:

  1. Disable the "OK" button if the date selected is invalid enable only when the selected date is valid.
  2. Set the default date to the minimum valid date. This way we can reduce the number of clicks the user has to do in order to select a valid date.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: [e.g. Pixel4a emulator]
  • Android version: [e.g. Settings -> About phone -> Android version]
  • Build number: [e.g. Settings -> About phone -> Build number]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Would you like to work on the issue?
Yes.

@AdityaKBhadragond14
Copy link
Author

@MJ1998 Please check if I have missed anything to add here. Thanks.

@MJ1998
Copy link
Collaborator

MJ1998 commented Apr 4, 2024

I would say disable the calendar popup itself when there is no valid date possible + show an error that there is no valid date.
Thanks Aditya.

@AdityaKBhadragond14
Copy link
Author

I would say disable the calendar popup itself when there is no valid date possible + show an error that there is no valid date. Thanks Aditya.

Okay, this will be for the case when the min and max dates are overlapping, right? Also I think going with 2nd solution to solve this issue would be better as you had suggested because this will avoid increasing the number of clicks.

@santosh-pingle santosh-pingle added P2 Medium priority issue ux labels Apr 8, 2024
@MJ1998
Copy link
Collaborator

MJ1998 commented Apr 8, 2024

Yes right. I suggested this I would say disable the calendar popup itself when there is no valid date possible + show an error that there is no valid date. only when max < min.
The other solution of yours seems correct!

@AdityaKBhadragond14
Copy link
Author

Okay got it.

@MJ1998 MJ1998 added the effort:small Small effort - 2 days label Apr 15, 2024
@AdityaKBhadragond14 AdityaKBhadragond14 linked a pull request Apr 18, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:small Small effort - 2 days P2 Medium priority issue ux
Projects
Status: New
Development

Successfully merging a pull request may close this issue.

3 participants