Skip to content

Commit e50fe97

Browse files
committed
Add story
1 parent 544d804 commit e50fe97

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

packages/react-aria-components/src/FileTrigger.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function FileTrigger(props: FileTriggerProps, ref: ForwardedRef<HTMLInputElement
4949

5050
return (
5151
<>
52-
<PressResponder
52+
<PressResponder
5353
onPress={() => {
5454
if (inputRef.current.value) {
5555
inputRef.current.value = '';
@@ -66,7 +66,7 @@ function FileTrigger(props: FileTriggerProps, ref: ForwardedRef<HTMLInputElement
6666
accept={acceptedFileTypes?.toString()}
6767
onChange={(e) => onSelect?.(e.target.files)}
6868
capture={defaultCamera}
69-
multiple={allowsMultiple}
69+
multiple={allowsMultiple}
7070
// @ts-expect-error
7171
webkitdirectory={directory ? '' : undefined} />
7272
</>

packages/react-aria-components/stories/index.stories.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,16 @@ export const FileTriggerButton = (props) => (
11661166
</FileTrigger>
11671167
);
11681168

1169+
export const FileTriggerDirectories = (props) => (
1170+
<FileTrigger
1171+
directory
1172+
onSelect={action('onSelect')}
1173+
data-testid="filetrigger-example"
1174+
{...props} >
1175+
<Button>Upload</Button>
1176+
</FileTrigger>
1177+
);
1178+
11691179
export const FileTriggerLinkAllowsMultiple = (props) => (
11701180
<FileTrigger
11711181
{...props}

0 commit comments

Comments
 (0)