Skip to content

Commit

Permalink
fix: use aria role presentation by default and close #1152
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandjitsu committed May 1, 2022
1 parent ed32886 commit 7a2f405
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/__snapshots__/index.spec.js.snap
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`useDropzone() hook behavior renders the root and input nodes with the necessary props 1`] = `"<div role=\\"button\\" tabindex=\\"0\\"><input multiple=\\"\\" type=\\"file\\" style=\\"display: none;\\" tabindex=\\"-1\\"></div>"`;
exports[`useDropzone() hook behavior renders the root and input nodes with the necessary props 1`] = `"<div role=\\"presentation\\" tabindex=\\"0\\"><input multiple=\\"\\" type=\\"file\\" style=\\"display: none;\\" tabindex=\\"-1\\"></div>"`;
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -885,7 +885,7 @@ export function useDropzone(props = {}) {
composeEventHandlers(onDragLeave, onDragLeaveCb)
),
onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb)),
role: typeof role === "string" && role !== "" ? role : "button",
role: typeof role === "string" && role !== "" ? role : "presentation",
[refKey]: rootRef,
...(!disabled && !noKeyboard ? { tabIndex: 0 } : {}),
...rest,
Expand Down
2 changes: 1 addition & 1 deletion src/index.spec.js
Expand Up @@ -3408,7 +3408,7 @@ describe("useDropzone() hook", () => {

expect(container.querySelector("#root")).toHaveAttribute(
"role",
"button"
"presentation"
);
});

Expand Down

0 comments on commit 7a2f405

Please sign in to comment.