Skip to content

Commit 536997c

Browse files
yuzhvarolandjitsu
authored andcommitted
fix: fix open file dialog programmatically and close react-dropzone#853
1 parent acea5df commit 536997c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,6 @@ export function useDropzone({
681681
onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave, onDragLeaveCb)),
682682
onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb)),
683683
[refKey]: rootRef,
684-
...(rootRef.current && rootRef.current.tagName === 'LABEL' ? { htmlFor: 'noop' } : {}),
685684
...(!disabled && !noKeyboard ? { tabIndex: 0 } : {}),
686685
...rest
687686
}),
@@ -706,7 +705,7 @@ export function useDropzone({
706705
}, [])
707706

708707
const getInputProps = useMemo(
709-
() => ({ refKey = 'ref', onChange, onClick, disabled, ...rest } = {}) => {
708+
() => ({ refKey = 'ref', onChange, onClick, ...rest } = {}) => {
710709
const inputProps = {
711710
accept,
712711
multiple,
@@ -716,7 +715,6 @@ export function useDropzone({
716715
onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),
717716
autoComplete: 'off',
718717
tabIndex: -1,
719-
disabled: disabled !== undefined ? disabled : noClick,
720718
[refKey]: inputRef
721719
}
722720

@@ -725,7 +723,7 @@ export function useDropzone({
725723
...rest
726724
}
727725
},
728-
[inputRef, accept, multiple, onDropCb, disabled, noClick]
726+
[inputRef, accept, multiple, onDropCb, disabled]
729727
)
730728

731729
const fileCount = draggedFiles.length

0 commit comments

Comments
 (0)