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

[Outreachy Task Submission] Keyboard Accessibility Issue With File Upload Button On Data Import Page #4903

Closed
Aquilaafuadajo opened this issue Mar 29, 2024 · 0 comments

Comments

@Aquilaafuadajo
Copy link

Description
On the data import page, the "upload csv file" button doesn't respond immediately to keyboard enter event, you have to tab twice. I initially thought it was the same issue with router link buttons in #982, but this one is different.

Why does this happen?
There are two issues with this implementation of file upload input:

  1. The button relies on the visually hidden input to be clicked before it opens up the file/folder widget so clicking on the area around the input doesn't open the input field unless you click on the input directly. see image below 👇🏽
Screenshot 2024-03-29 at 12 01 40
  1. The visually hidden input also receives an extra focus when tabbed into.

Fix
Use the button to programmatically control the input by using the it's elementRef and set the tabindex of the visually hidden input to -1 to prevent the extra focus. This way when any area of the button is clicked it opens up the file/folder widget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants