Skip to content

Commit

Permalink
fix(packages/viewer): add directory option to file input
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlomoh committed Sep 13, 2024
1 parent 4212893 commit a97d2c9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion apps/official-website/src/pages/editor/drop-zone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ import { Card, CardContent } from '@vctrl/shared/components';
import TypographyLead from '../../components/typography/typography-lead';
import { useIsMobile } from '../../lib/hooks';

declare module 'react' {
interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
// extends React's HTMLAttributes
directory?: string;
webkitdirectory?: string;
}
}

const DropZone = () => {
const isMobile = useIsMobile();
const { getRootProps, getInputProps, isDragActive, acceptedFiles } =
Expand Down Expand Up @@ -54,7 +62,12 @@ const DropZone = () => {
<TypographyLead isHighlighted={isDragActive}>
Click here, or drag and drop your 3D model files
</TypographyLead>
<input {...getInputProps()} />
<input
{...getInputProps()}
webkitdirectory="true"
directory="true"
multiple
/>
</div>
</CardContent>
</Card>
Expand Down

0 comments on commit a97d2c9

Please sign in to comment.