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

Improve time picker accessibility #4181

Merged

Conversation

theopolisme
Copy link
Contributor

* Explicitly declare the Time picker as a listbox
* Add support for keyboard Arrow events to navigate the Time picker
* When Time picker focused, initially focus the currently selected time, or whatever time was initially scrolled into view, rather than always focusing the last time
Copy link

@pullrequest pullrequest bot left a 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.


@theopolisme you can click here to see the review status or cancel the code review job.

Copy link

@pullrequest pullrequest bot left a 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

+ 97
- 21

59% JavaScript
41% JavaScript (tests)

Type of change

Feature - These changes are adding a new feature or improvement to existing code.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

Overall the change looks good and has appropriate testing. A minor React issue is noted, but it's not something that impacts functionality.

Image of David K David K


Reviewed with ❤️ by PullRequest

return times.map((time, i) => {
return (
<li
key={i}
Copy link

Choose a reason for hiding this comment

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

In general it's a React best practice to not use integer indexes as the key. It would be better to use the string representation of the time.

🔹 Best Practices (Nice to have)

Image of David K David K

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This code was not modified in this PR (just whitespace changes)

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

Looks easy enough, some simple UX questions around focus handling.

Image of Steven S Steven S


Reviewed with ❤️ by PullRequest

event.target.nextSibling
) {
event.preventDefault();
event.target.nextSibling.focus();
Copy link

Choose a reason for hiding this comment

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

What about ctrl+arrow? What about wrapping when it reaches the beginning or end, should it wrap?

🔹 Reduce Future Bugs (Nice to have)

Image of Steven S Steven S

@codecov
Copy link

codecov bot commented Jul 31, 2023

Codecov Report

Merging #4181 (b0a810d) into main (2f840eb) will decrease coverage by 0.28%.
The diff coverage is 57.89%.

❗ Current head b0a810d differs from pull request most recent head be6af4c. Consider uploading reports for the commit be6af4c to get more accurate results

@@            Coverage Diff             @@
##             main    #4181      +/-   ##
==========================================
- Coverage   94.02%   93.75%   -0.28%     
==========================================
  Files          20       20              
  Lines        1890     1904      +14     
  Branches      458      464       +6     
==========================================
+ Hits         1777     1785       +8     
- Misses         40       43       +3     
- Partials       73       76       +3     
Files Changed Coverage Δ
src/time.jsx 84.33% <57.89%> (-8.42%) ⬇️

... and 1 file with indirect coverage changes

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

PullRequest reviewed the updates made to #4181 since our last review was posted. This includes comments that have been posted by non-PullRequest reviewers. No further issues were found.

Reviewed by:

Image of David K David K

@martijnrusschen
Copy link
Member

Looks good, merging. Thank you!

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.

Keyboard navigation when including times is very cumbersome (Accessibility)
2 participants