[Upload] File upload button not keyboard accessible
See original GitHub issue- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate. –> There is this related issue, but the discussion ended up shifting away from the file upload button.
Current Behavior 😯
Following the official file upload button example, once one of the upload button is keyboard focused, pressing on enter
or the spacebar
does not do anything.
Expected Behavior 🤔
Following the official file upload button example, once one of the upload button is keyboard focused, pressing on enter
or the spacebar
should open the file selection dialog.
Steps to Reproduce 🕹
Steps:
- Go to https://codesandbox.io/s/hidden-currying-e83y7
- Click on the
browser
part of the window. - Press
tab
once or twice (to respectively select the first or the second button). - Press
enter
orspacebar
, nothing happens.
Context 🔦
This is an accessibility requirement: https://webaim.org/techniques/keyboard/#testing
Your Environment 🌎
Tech | Version |
---|---|
Material-UI | v4.11.0 |
React | v16.13.1 |
Browser | Firefox 79.0 and Chromium 84.0.4147.89 (on Linux) |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (5 by maintainers)
Top Results From Across the Web
[Upload] File upload button not keyboard accessible #22141
It could be caused by a setting in your operating system. In the end user agents decide what elements are keyboard focusable and...
Read more >A styled accessible file upload - Accessabilly
No keyboard accessibility: Most users of screenreaders use the keyboard to navigate. But you can not focus the label by using your keyboard....
Read more >Make upload file label accessible by spacebar and enter
I am trying to create a keyboard accessible upload page using angular 2. I am having trouble to enable "Choose a file to...
Read more >accessibility issue - upload is not notifying files are chosen
The files dialog for selection in Upload is not opening on clicking enter or space on the keyboard while the NVDA screen reader...
Read more >Accessibility - File uploader - Carbon Design System
The 'Drag files' area is constructed as a button to support keyboard operation. Error messages about file uploads must be exposed to assistive...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The problem is not about focusability, but about opening the file selection dialog.
With a vanilla
<input type=file>
, opening the file selection dialog can be achieved by focusing on the element and usingenter
orspacebar
.Closing in favor of #22434. A dedicated component would fix existing usages which we can’t really do with demos.