Skip to content

Commit 738c169

Browse files
committed
feat(FileInput): accept prop support
1 parent c93c520 commit 738c169

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changeset/seven-pugs-cry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cube-dev/ui-kit': patch
3+
---
4+
5+
Support "accept" attribute in FileInput component.

src/components/forms/FileInput/FileInput.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ export interface CubeFileInputProps
118118
type?: 'file' | 'text';
119119
/** Direct input props */
120120
inputProps?: Props;
121+
/** The file types that the input should accept */
122+
accept?: string;
121123
}
122124

123125
function extractContents(element, callback) {
@@ -164,6 +166,7 @@ function FileInput(props: CubeFileInputProps, ref) {
164166
labelSuffix,
165167
type = 'file',
166168
inputProps,
169+
accept,
167170
...otherProps
168171
} = props;
169172

@@ -230,6 +233,7 @@ function FileInput(props: CubeFileInputProps, ref) {
230233
ref={inputRef}
231234
id={id}
232235
name={name}
236+
accept={accept}
233237
data-element="Input"
234238
type="file"
235239
tabIndex={-1}

0 commit comments

Comments
 (0)