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

Refocus calendar button after calendar modal close in Home page #463

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Enochen
Copy link
Contributor

@Enochen Enochen commented Sep 29, 2023

Summary

Fixes Issue 4 of Keyboard Testing task

Test Plan

After opening the calendar and selecting +interacting with a day (thus closing the calendar popup), browser focus is now pointed at the button that opens the calendar, instead of an invisible element like before.

Notes

I had to do a weird trick with the customInputRef prop in the DatePicker component to get the ref to the button to persist. Unfortunately, react-datepicker doesn't seem to provide a better way to focus on our custom button input (at least I couldn't find anything).

@Enochen Enochen requested a review from a team as a code owner September 29, 2023 20:07
@dti-github-bot
Copy link
Member

[diff-counting] Significant lines: 31.

Copy link
Collaborator

@Atikpui007 Atikpui007 left a comment

Choose a reason for hiding this comment

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

Very thorough PR

I did some research and could not find anything on native react-date picker methods that could address the issue like you said.

Good use of the custom Input Ref to address the focus issue

I performed the test and it works as expected
Some notes - I know this wasn't part of the ticket but since there are buttons without ARIA labels can you ensure they are correctly labeled so as not to come back to make accessibility changes

@namanhboi
Copy link
Contributor

I pulled the PR and after selecting a day, it indeed refocuses on the calendar element. PR works as expected.

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.

4 participants