Skip to content

Commit

Permalink
fix(VFileInput): add hideInput prop (#17270)
Browse files Browse the repository at this point in the history
resolves #17142

Co-authored-by: John Leider <john@vuetifyjs.com>
  • Loading branch information
Reidemption and johnleider committed Apr 15, 2024
1 parent f909381 commit 614262e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions packages/vuetify/src/components/VFileInput/VFileInput.sass
Expand Up @@ -6,6 +6,16 @@
// Block
.v-file-input

&--hide.v-input
.v-field,
.v-input__control,
.v-input__details
display: none

.v-input__prepend
grid-area: control
margin: 0 auto

&--chips.v-input--density-compact
.v-field--variant-solo,
.v-field--variant-solo-inverted,
Expand Down
4 changes: 3 additions & 1 deletion packages/vuetify/src/components/VFileInput/VFileInput.tsx
Expand Up @@ -51,6 +51,7 @@ export const makeVFileInputProps = propsFactory({
type: String,
default: '$vuetify.fileInput.counter',
},
hideInput: Boolean,
multiple: Boolean,
showSize: {
type: [Boolean, Number, String] as PropType<boolean | 1000 | 1024>,
Expand Down Expand Up @@ -178,6 +179,7 @@ export const VFileInput = genericComponent<VFileInputSlots>()({
'v-file-input',
{
'v-file-input--chips': !!props.chips,
'v-file-input--hide': props.hideInput,
'v-input--plain-underlined': isPlainOrUnderlined.value,
},
props.class,
Expand Down Expand Up @@ -247,7 +249,7 @@ export const VFileInput = genericComponent<VFileInputSlots>()({
/>

<div class={ fieldClass }>
{ !!model.value?.length && (
{ !!model.value?.length && !props.hideInput && (
slots.selection ? slots.selection({
fileNames: fileNames.value,
totalBytes: totalBytes.value,
Expand Down

0 comments on commit 614262e

Please sign in to comment.