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.

[BUG] Using Dropzone with an interactive element inside causes accessibility violation

See original GitHub issue

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

  1. The react-dropzone doc site and go to the Opening File Dialog Programmatically example.
  2. 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 Screen Shot 2022-03-08 at 3 08 56 PM Screen Shot 2022-03-08 at 3 17 34 PM

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:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
emilyuhdecommented, Mar 9, 2022

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'})}>

0reactions
github-actions[bot]commented, May 1, 2022

🎉 This issue has been resolved in version 14.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

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

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