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

Datepicker Modal Dialog: Fixed next/prev month bug and improve adherence with APG code style guide #2643

Merged
merged 13 commits into from Jun 6, 2023

Conversation

jongund
Copy link
Contributor

@jongund jongund commented Mar 14, 2023

This PR complements #2618 to provide the remaining changes to resolve issue #2581.

This PR changes behavior of commands for next and previous month and year In the date picker dialog when the currently focused date does not exist in the previous or next month or year. With these changes, if the same day number does not exist in the newly displayed month, the last day of the newly displayed month receives focus.

In addition to the above enhancement, this PR also includes the following changes:

  • Updates coding practices to use class constructor and pointer events
  • Updates documentation of page up and page down commands
  • Updates regression tests for page up and page down commands

Preview updated Date Picker Modal Dialog Example

Review checklist


WAI Preview Link (Last built on Tue, 16 May 2023 19:24:24 GMT).

@jongund jongund requested a review from mcking65 March 15, 2023 13:34
mcking65 added a commit that referenced this pull request Apr 4, 2023
… behavior for dates near end of month (pull #2618)

Provides partial resolution of #2581.
The remainder of the resolution is provided by #2643.

This PR changes behavior of commands for next and previous month and year In the combobox date picker when the currently focused date does not exist in the previous or next month or year. With these changes, if the same day number does not exist in the newly displayed month, the last day of the newly displayed month receives focus.

---------

Co-authored-by: Matt King <a11yThinker@gmail.com>
@mcking65 mcking65 changed the title Datepicker Modal Dialog: Updated code and fixed next/prev month bug Datepicker Modal Dialog: Fixed next/prev month bug and improve adherence with APG code style guide Apr 4, 2023
@ariellalgilmore ariellalgilmore self-requested a review April 4, 2023 18:17
@mcking65 mcking65 requested review from alflennik and removed request for ariellalgilmore April 4, 2023 18:17
@css-meeting-bot
Copy link
Member

The ARIA Authoring Practices (APG) Task Force just discussed PR 2643 - Datepicker Modal Dialog: Updated code and fixed next/prev month bug by jongund.

The full IRC log of that discussion <jugglinmike> Subtopic: PR 2643 - Datepicker Modal Dialog: Updated code and fixed next/prev month bug by jongund
<jugglinmike> github: https://github.com//pull/2643
<jugglinmike> Matt_King: I'll be doing the editorial review
<jugglinmike> Matt_King: I'm looking for support on visual design review, code review, and testing
<jugglinmike> Matt_King: There aren't a lot of changes in this pull request; it's only four files (one CSS and two JS and on HTML)
<jugglinmike> Matt_King: Because there was a small change to the CSS, I want to make sure someone is looking at this visually
<jugglinmike> arigilmore: I can do visual review and code review
<jugglinmike> Matt_King: Great--thank you
<jugglinmike> Alex_Flenniken: I can do the test review
<jugglinmike> Matt_King: arigilmore do you think you'll be able to do that review this week?
<jugglinmike> arigilmore: Yes

@css-meeting-bot
Copy link
Member

The ARIA Authoring Practices (APG) Task Force just discussed PR 2643 - Datepicker Modal Dialog: Updated code and fixed next/prev month bug by jongund.

The full IRC log of that discussion <jugglinmike> subtopic: PR 2643 - Datepicker Modal Dialog: Updated code and fixed next/prev month bug by jongund
<jugglinmike> github: https://github.com//pull/2643
<jugglinmike> Matt_King: It looks like arigilmore_ has done her piece
<jugglinmike> Matt_King: Looks like it's just for me and Alex to wrap up

Copy link
Contributor

@mcking65 mcking65 left a comment

Choose a reason for hiding this comment

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

Functional and editorial review complete. Good to go.

@css-meeting-bot
Copy link
Member

The ARIA Authoring Practices (APG) Task Force just discussed PR 2643 - Datepicker Modal Dialog: Updated code and fixed next/prev month bug by jongund.

The full IRC log of that discussion <jugglinmike> Subtopic: PR 2643 - Datepicker Modal Dialog: Updated code and fixed next/prev month bug by jongund
<jugglinmike> github: https://github.com//pull/2643
<jugglinmike> Matt_King: I think this is really close
<jugglinmike> Matt_King: The only thing we're waiting on is a review of the regression tests by Alex_Flenniken
<jugglinmike> jugglinmike: That will probably not happen this week due to Bocoup's week-long "all-hands" meeting taking place now

@a11ydoer
Copy link
Contributor

@alflennik would it be possible for you to review Datepicker Modal Dialog update so that we can merge this?

@ccanash
Copy link

ccanash commented Apr 27, 2023

Hi @a11ydoer , Alex had an issue running the test locally and will need additional time to do this review so we will have to put it into our triaging processes. I will provide an update next week.

);
};

const checkDate = async function assertAriaRoles(t, dateSelector, day) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const checkDate = async function assertAriaRoles(t, dateSelector, day) {
const checkDate = async function (t, dateSelector, day) {

This line creates a function named assertAriaRoles and stores it in a variable named checkDate. The name is somewhat confusing in this context because this file already has a function stored in the variable assertAriaRoles.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jugglinmike
Thank you for the feedback, I updated the code.

};

const checkDate = async function assertAriaRoles(t, dateSelector, day) {
const d = day.getDate() < 10 ? '0' + day.getDate() : day.getDate();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const d = day.getDate() < 10 ? '0' + day.getDate() : day.getDate();
const d = String(day.getDate()).padStart(2, '0');

The code works as written, so you can take or leave this suggestion (I just feel it communicates your intent better).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jugglinmike
Thank you for the suggestion, I updated the code.

Comment on lines 841 to 849
const startDate = '1/31/2023';
const targetDates = [
'1/31/2022',
'1/31/2021',
'1/31/2020',
'1/31/2019',
'1/31/2018',
'1/31/2017',
];
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't demonstrate the bug fix (it passes on the main branch). Starting from 2020-02-29 would do it, though

Suggested change
const startDate = '1/31/2023';
const targetDates = [
'1/31/2022',
'1/31/2021',
'1/31/2020',
'1/31/2019',
'1/31/2018',
'1/31/2017',
];
const startDate = '2/29/2020';
const targetDates = [
'2/28/2019',
'2/28/2018',
'2/28/2017',
'2/29/2016',
'2/28/2015',
'2/28/2014',
];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jugglinmike
Thank you for the feedback, I updated the code.

@mcking65 mcking65 removed the request for review from alflennik May 16, 2023 18:39
@css-meeting-bot
Copy link
Member

The ARIA Authoring Practices (APG) Task Force just discussed Datepicker Modal Dialog: Fixed next/prev month bug and improve adherence with APG code style guide.

The full IRC log of that discussion <jugglinmike> Subtopic: Datepicker Modal Dialog: Fixed next/prev month bug and improve adherence with APG code style guide
<jugglinmike> github: https://github.com//pull/2643
<jugglinmike> Matt_King: jongund , about two weeks ago, jugglinmike posted feedback for you on the tests
<jugglinmike> jongund: I'll take a look

@jongund
Copy link
Contributor Author

jongund commented May 16, 2023

@jugglinmike @mcking65
Ready to review updated test cases

Copy link
Contributor

@jugglinmike jugglinmike left a comment

Choose a reason for hiding this comment

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

The tests look good to @Paul-Clue and me, @jongund! Thanks!

@css-meeting-bot
Copy link
Member

The ARIA Authoring Practices (APG) Task Force just discussed Datepicker Modal Dialog: Fixed next/prev month bug and improve adherence with APG code style guide.

The full IRC log of that discussion <jugglinmike> subtopic: Datepicker Modal Dialog: Fixed next/prev month bug and improve adherence with APG code style guide
<jugglinmike> github: https://github.com//pull/2643
<jugglinmike> jugglinmike: I reviewed and approved the tests with Paul at Bocoup.
<jugglinmike> Matt_King: Then I think this is ready to merge

Copy link
Contributor

@mcking65 mcking65 left a comment

Choose a reason for hiding this comment

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

Thank you @jongund for all your work on this!! This is now ready to ship!

@mcking65 mcking65 merged commit 32c7ef2 into main Jun 6, 2023
20 checks passed
@mcking65 mcking65 deleted the bugfix/datepicker-dialog branch June 6, 2023 15:48
@mcking65 mcking65 added bug Code defects; not for inaccurate prose enhancement Any addition or improvement that doesn't fix a code bug or prose inaccuracy Example Page Related to a page containing an example implementation of a pattern Code Quality Non-functional code changes to satisfy APG code style guidelines and linters labels Jun 6, 2023
@mcking65 mcking65 added this to In progress in Date Picker Pattern and Examples Development Project via automation Jun 6, 2023
@mcking65 mcking65 added this to the H1/2023 Content Updates milestone Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Code defects; not for inaccurate prose Code Quality Non-functional code changes to satisfy APG code style guidelines and linters enhancement Any addition or improvement that doesn't fix a code bug or prose inaccuracy Example Page Related to a page containing an example implementation of a pattern
Development

Successfully merging this pull request may close these issues.

None yet

7 participants