Skip to content

Commit

Permalink
[@mantine/dropzone] Add inputProps prop support to pass props down …
Browse files Browse the repository at this point in the history
…to the underlying hidden input element (#5880)

Co-authored-by: Adarsh Jaiswal <adarshjaiswal@Adarshs-MacBook-Air.local>
  • Loading branch information
AdarshJais and Adarsh Jaiswal committed Mar 12, 2024
1 parent fe37252 commit df009e2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/@mantine/dropzone/src/Dropzone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ export interface DropzoneProps

/** Props passed down to the Loader component */
loaderProps?: LoaderProps;

/** Props passed down to the internal Input component */
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
}

export type DropzoneFactory = Factory<{
Expand Down Expand Up @@ -228,6 +231,7 @@ export const Dropzone = factory<DropzoneFactory>((_props, ref) => {
acceptColor,
enablePointerEvents,
loaderProps,
inputProps,
mod,
...others
} = props;
Expand Down Expand Up @@ -297,7 +301,7 @@ export const Dropzone = factory<DropzoneFactory>((_props, ref) => {
unstyled={unstyled}
loaderProps={loaderProps}
/>
<input {...getInputProps()} name={name} />
<input {...getInputProps(inputProps)} name={name} />
<div {...getStyles('inner')} data-enable-pointer-events={enablePointerEvents || undefined}>
{children}
</div>
Expand Down

0 comments on commit df009e2

Please sign in to comment.