question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:

  1. Go to https://codesandbox.io/s/hidden-currying-e83y7
  2. Click on the browser part of the window.
  3. Press tab once or twice (to respectively select the first or the second button).
  4. Press enter or spacebar, 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
tcxcommented, Aug 10, 2020

The problem is not about focusability, but about opening the file selection dialog.

  • If you mouse click on the button, you’ll get a file selection dialog.
  • There is no way to open the same file selection dialog only with the keyboard.

With a vanilla <input type=file>, opening the file selection dialog can be achieved by focusing on the element and using enter or spacebar.

1reaction
eps1loncommented, May 22, 2021

Closing in favor of #22434. A dedicated component would fix existing usages which we can’t really do with demos.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found