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

bug: Autocomplete v-model binds object rather than value #72

Open
this-gavagai opened this issue May 24, 2023 · 0 comments
Open

bug: Autocomplete v-model binds object rather than value #72

this-gavagai opened this issue May 24, 2023 · 0 comments

Comments

@this-gavagai
Copy link

The v-model property is currently not working correctly on the Autocomplete component. Instead of binding to the value of the label/value object, it binds to the entire object.

See the following example, taken directly from the documentation:

<template>
  <div class="max-w-screen-md m-auto p-12">
    <Autocomplete
      :options="[
        { label: 'Apple', value: 'apple' },
        { label: 'Banana', value: 'banana' },
        { label: 'Orange', value: 'orange' },
      ]"
      v-model="fruit"
      placeholder="Select a fruit"
    />
    <pre>{{ fruit }}</pre>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { Autocomplete } from 'frappe-ui'
const fruit = ref('')
</script>

The following output is produced:
Screenshot 2023-05-24 at 2 02 11 PM

@this-gavagai this-gavagai changed the title bug: Autocomplete v-model broken bug: Autocomplete v-model binds object rather than value May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant