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

ui-core: enable the user to type in the date picker #547

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

clarani
Copy link
Contributor

@clarani clarani commented Sep 24, 2024

closes #526

Some remarks:

  • when the user clicks on the input, the calendar is not opened automatically anymore
  • if the user types a string which is not a date, the date value is not updated
  • if the user types a valid string but the date is not in the selectable slot, then an error is displayed (the invalid date is not updated in the parent component)
  • if the calendar is opened and the user enters a valid date, then the calendar view is correctly updated
  • if an invalid date is entered and the user picks a date from the calendar, then the error is not displayed anymore

Technical remarks:

  • I moved the selectableSlot props so it is more easier to access it

When the input is invalid:
image

@clarani clarani requested a review from a team as a code owner September 24, 2024 15:05
@clarani clarani force-pushed the cni/526-enable-user-to-type-in-datepicker branch from dbdf90d to 0e4b6ce Compare September 24, 2024 15:10
Copy link
Contributor

@achrafmohye achrafmohye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and tested 👍

Copy link
Contributor

@kmer2016 kmer2016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work !

Please, could you update tests for handleInputClick and add tests for handleInputOnChange ?

I noticed a strange behavior with the date validation:

  1. When I enter a date that is out of the allowed range, the date picker shows the error message correctly.
  2. If I then type something that is not a date (e.g., "toto"), the date picker stays in error mode, which is expected.
  3. However, when I enter a valid date afterward, the date picker still shows as invalid, even though it should reset.

Also, when I type a non-date string (e.g., "toto") from the beginning, the input does not show an invalid message.

@clarani
Copy link
Contributor Author

clarani commented Sep 25, 2024

Thanks for your review, I modified a bit the behaviors:

  • if the user enters a string which does not contain only slashes and numbers, then an error is displayed (example toto)
  • if the user enters a string which contains only slashes and numbers but which is longer than 8 characters, then an error is displayed (for instance 01/01/2024)

Copy link
Contributor

@kmer2016 kmer2016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job !

@clarani clarani force-pushed the cni/526-enable-user-to-type-in-datepicker branch from 0538bc0 to 91f1a45 Compare September 27, 2024 07:28
@clarani clarani enabled auto-merge September 27, 2024 07:28
@clarani clarani added this pull request to the merge queue Sep 27, 2024
Merged via the queue into dev with commit 1e97d0a Sep 27, 2024
6 checks passed
@clarani clarani deleted the cni/526-enable-user-to-type-in-datepicker branch September 27, 2024 07:33
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

Successfully merging this pull request may close these issues.

ui-core: enable to type in the datePicker
3 participants