[BUG] Using Dropzone with an interactive element inside causes accessibility violation
See original GitHub issueDescribe the bug
If you use the Dropzone component with an interactive element inside of it, such as a button used in the “Opening File Dialog Programmatically” example, it will cause an a11y issue because you have nested interactive elements. In the case of this example, it’s a <div role="button">
around a <button>
but the same will be true if you use a link instead.
To Reproduce Steps to reproduce the behavior:
- The react-dropzone doc site and go to the Opening File Dialog Programmatically example.
- Right click the “Open File Dialog” button in the example and inspect the element.
Alternatively, you can run Axe (https://www.deque.com/axe/browser-extensions/) on the same example.
Expected behavior There are no nested interactive elements and no accessibility violations.
Screenshots
Desktop (please complete the following information):
- OS: macOS
- Browser: Chrome, but it’ll be the same in any browser
- Version: 99.0.4844.51
Issue Analytics
- State:
- Created 2 years ago
- Comments:7
Top Results From Across the Web
Nested interactive controls are not announced by screen ...
Focusable elements with an interactive control ancestor (any element that accepts user input such as button or anchor elements) are not announced by...
Read more >Multiple dropzones on same page cause bugs to appear
The problem is that info is always displayed only in the last dropzone, in the last previewtemplate. For example: When I have two...
Read more >HTML5 - W3C
The use of presentational elements leads to poorer accessibility ... that appears in a form's elements array would be in violation of the...
Read more >2018 - Dimitri Gielis Blog (Oracle Application Express - APEX)
In Oracle Application Express 18.1 there's a small bug (Bug 28298260 ... it all depends on your use case what technique makes sense...
Read more >Selectors for Skinning ADF Faces Components
This document lists the selectors that can be used in an ADF Faces skin ... See Bug 6931294 - ie7 setting styles in...
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
A possible solution would be adding a valid override to this example, if having the default role of “button” is the most common case.
<div {...getRootProps({role: 'presentation'})}>
🎉 This issue has been resolved in version 14.0.1 🎉
The release is available on:
Your semantic-release bot 📦🚀