Skip to content

Commit

Permalink
Merge pull request #120 from rjsdnql123/dev
Browse files Browse the repository at this point in the history
(feat): adding aria-label, aria-describedby, role
  • Loading branch information
KarimMokhtar authored Oct 22, 2024
2 parents 6fd6cb6 + a36f9ff commit 6944fc5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/FileUploader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ type Props = {
handleChange?: (arg0: File | Array<File> | File) => void;
onDraggingStateChange?: (dragging: boolean) => void;
dropMessageStyle?: React.CSSProperties | undefined;
ariaLabel?: string | undefined;
ariaDescribedby?: string | undefined;
};
/**
*
Expand Down Expand Up @@ -136,7 +138,9 @@ const FileUploader: React.FC<Props> = (props: Props): JSX.Element => {
multiple,
required,
onDraggingStateChange,
dropMessageStyle
dropMessageStyle,
ariaLabel,
ariaDescribedby
} = props;
const labelRef = useRef<HTMLLabelElement>(null);
const inputRef = useRef<HTMLInputElement>(null);
Expand Down Expand Up @@ -235,6 +239,9 @@ const FileUploader: React.FC<Props> = (props: Props): JSX.Element => {
ref={labelRef}
htmlFor={name}
onClick={blockEvent}
aria-describedby={ariaDescribedby}
role="button"
aria-label={ariaLabel}
>
<input
onClick={handleClick}
Expand Down

0 comments on commit 6944fc5

Please sign in to comment.