-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fix #4482: Update Month Picker and Year Picker to select dates also on press of "SPACE" key #4512
Fix #4482: Update Month Picker and Year Picker to select dates also on press of "SPACE" key #4512
Conversation
Adjust Month picker and Year picker to align with W3C WAI-ARIA principles. Previously, the date gets selected only on "Enter" key press. After this change, [both "Enter" and "Space" can select a date from both Month picker and Year picker](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ This pull request was sent to the PullRequest network.
@balajis-qb you can click here to see the review status or cancel the code review job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PullRequest Breakdown
Reviewable lines of change
+ 62
- 0
76% JavaScript (tests)
24% JavaScript
Type of change
Fix - These changes are likely to be fixing a bug or issue.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4512 +/- ##
==========================================
+ Coverage 95.39% 95.41% +0.01%
==========================================
Files 29 29
Lines 2521 2530 +9
Branches 1021 1023 +2
==========================================
+ Hits 2405 2414 +9
Misses 116 116 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine but I do think you could define that constant in one central location
Reviewed with ❤️ by PullRequest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without expanding the scope of the requested change, this appears to be the most sensible way to do it. A part of me would welcome a refactor of this code to simplify it, but the ROI may not be there on this.
Found a small likely typo/copy&paste error.
Hope you found this review helpful.
Reviewed with ❤️ by PullRequest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes #4482
Description
This PR addresses the date selection behavior in the calendar component to enhance accessibility based on W3C WAI-ARIA principles. Previously, the
Enter
key alone is used to select a Month picker and a Year Picker. But As per the W3C WAI-ARIA principle, both theEnter
&Space
keys should be able to select a date. Currently, only the date selector is selecting a date on both theEnter
and theSpace
key. Hence I updated the Year Picker and the Month Picker to work like the date picker to select a date both bySpace
andEnter
keys.Reference Link
Changes Made