Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: dropzone: ensures tab key event is not prevented
Browse files Browse the repository at this point in the history
dkilgore-eightfold committed Oct 17, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent f85cc7f commit 8e3e99f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/Upload/Upload.tsx
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ import LocaleReceiver, {
} from '../LocaleProvider/LocaleReceiver';
import { useCanvasDirection } from '../../hooks/useCanvasDirection';
import { useMergedState } from '../../hooks/useMergedState';
import { mergeClasses, warning } from '../../shared/utilities';
import { eventKeys, mergeClasses, warning } from '../../shared/utilities';
import enUS from './Locale/en_US';

import styles from './upload.module.scss';
@@ -554,7 +554,11 @@ const InternalUpload: React.ForwardRefRenderFunction<unknown, UploadProps> = (
classNames={styles.uploadDropButton}
disabled={mergedDisabled}
htmlType={'button'}
onKeyDown={(event) => event.preventDefault()}
onKeyDown={(event: React.KeyboardEvent<HTMLButtonElement>) => {
if (event.key !== eventKeys.TAB) {
event.preventDefault();
}
}}
text={maxCount === 1 ? selectFileText : selectMultipleFilesText}
/>
);

0 comments on commit 8e3e99f

Please sign in to comment.