Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(VFileInput): emit single file when default model value is undefined & multiple is false #19656

Merged
merged 3 commits into from
Apr 22, 2024

Conversation

yuwu9145
Copy link
Member

@yuwu9145 yuwu9145 commented Apr 20, 2024

v-model emits array when initialised to undefined, but null emits single file

Description

Markup:

<template>
  <v-app>
    <v-container>
      <v-file-input
        label="File input"
        v-model="msg"
      />
    </v-container>
  </v-app>
</template>

<script setup>
  import { ref, watch } from 'vue'

  const msg = ref()

  watch(msg, val => {
    console.log('isArray', Array.isArray(val))
    console.log(val)
  })
</script>

@yuwu9145 yuwu9145 changed the title fix(VFileInput): emit single file when multiple is false fix(VFileInput): emit single file when default model value is undefined & multiple is false Apr 20, 2024
@johnleider johnleider added this to the v3.5.x milestone Apr 22, 2024
@johnleider johnleider added T: bug Functionality that does not work as intended/expected C: VFileInput labels Apr 22, 2024
@df-pkennedy
Copy link

I know this is a bit late (we've been negligent in our updates), but this shouldn't have been a bug but a breaking change since it fundamentally alters the API, even if the behavior was unintended. At the very least it broke a feature that was unrelated to any changes we made during our less than clean update process.

Something to note for the future!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VFileInput T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants