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 year focus & two digit year format fix #1439

Merged
merged 17 commits into from Jan 30, 2023
Merged

Conversation

Jialecl
Copy link
Collaborator

@Jialecl Jialecl commented Jan 16, 2023

Checklist
(Check off all the items before submitting)

  • Build process is done without errors and all tests pass in /lib directory.
  • Self-reviewed the code prior to submitting.
  • Meets accessibility standards.
  • Added/updated documentation to /website as needed.
  • Added/updated tests as needed.

Purpose
Fixed some bugs:

  • Fixed bug related to the focus when a year is selected
  • Improved functionality when it is two-digit year format

And added some tests.

Description
Added a third party library to mock the "today value" in the tests.
Added visual tests and a new test for the new behavior related to the two-digit year format.

The two-digit year format behavior works like this:
The first time a valid year is entered it will remember the value.
If we change the value of the year in the input it will add the first two digits of the year based on the last valid date year.

Closes #1435

@Jialecl Jialecl marked this pull request as ready for review January 17, 2023 11:14
@aidamag aidamag self-assigned this Jan 23, 2023
lib/src/date-input/DateInput.stories.tsx Outdated Show resolved Hide resolved
lib/src/date-input/DateInput.stories.tsx Outdated Show resolved Hide resolved
lib/src/date-input/DateInput.stories.tsx Outdated Show resolved Hide resolved
lib/src/date-input/DateInput.stories.tsx Outdated Show resolved Hide resolved
lib/src/date-input/DateInput.stories.tsx Outdated Show resolved Hide resolved
lib/src/date-input/YearPicker.tsx Outdated Show resolved Hide resolved
lib/src/date-input/YearPicker.tsx Outdated Show resolved Hide resolved
lib/src/date-input/Calendar.tsx Outdated Show resolved Hide resolved
lib/src/date-input/Calendar.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@GomezIvann GomezIvann left a comment

Choose a reason for hiding this comment

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

We are missing a test to check z-index in regards to the Date Picker popover.

image

lib/src/date-input/Calendar.tsx Outdated Show resolved Hide resolved
lib/src/date-input/DateInput.tsx Outdated Show resolved Hide resolved
lib/src/date-input/DateInput.stories.tsx Outdated Show resolved Hide resolved
lib/src/date-input/DateInput.stories.tsx Outdated Show resolved Hide resolved
lib/src/date-input/DatePicker.tsx Outdated Show resolved Hide resolved
@GomezIvann GomezIvann self-assigned this Jan 27, 2023
Copy link
Collaborator

@GomezIvann GomezIvann left a comment

Choose a reason for hiding this comment

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

Some comments:

  • Counting each component of the Date Input, we currently have 5 icons. Maybe we can create an Icons.tsx file as in other components and export them from there.
  • Why do both leftCaret and rightCaret have aria-hidden set to true?
  • Remove the unused import from Calendar.tsx.

image

lib/src/date-input/DateInput.stories.tsx Outdated Show resolved Hide resolved
@GomezIvann GomezIvann merged commit 453c87a into master Jan 30, 2023
@GomezIvann GomezIvann deleted the jialecl-dateReview branch January 30, 2023 16:28
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.

Date input not selecting correct the year with specific format
3 participants