Skip to content

Commit e6c39bc

Browse files
committed
fix(VFileInput, VFileUpload): avoid invalid accept when not defined
fixes #22131
1 parent fb3c322 commit e6c39bc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/vuetify/src/components/VFileInput/VFileInput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ export const VFileInput = genericComponent<VFileInputSlots>()({
239239
}
240240

241241
const expectsDirectory = attrs.webkitdirectory !== undefined && attrs.webkitdirectory !== false
242-
const inputAccept = expectsDirectory ? undefined : (props.filterByType ?? String(attrs.accept))
242+
const acceptFallback = attrs.accept ? String(attrs.accept) : undefined
243+
const inputAccept = expectsDirectory ? undefined : (props.filterByType ?? acceptFallback)
243244

244245
return (
245246
<VInput

packages/vuetify/src/labs/VFileUpload/VFileUpload.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ export const VFileUpload = genericComponent<VFileUploadSlots>()({
192192
const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)
193193

194194
const expectsDirectory = attrs.webkitdirectory !== undefined && attrs.webkitdirectory !== false
195-
const inputAccept = expectsDirectory ? undefined : (props.filterByType ?? String(attrs.accept))
195+
const acceptFallback = attrs.accept ? String(attrs.accept) : undefined
196+
const inputAccept = expectsDirectory ? undefined : (props.filterByType ?? acceptFallback)
196197

197198
const inputNode = (
198199
<input

0 commit comments

Comments
 (0)