0

Even if v-autocomplete loses focus I don't want the text to be deleted

If you enter text that is not included in the item and lose focus, it will be deleted.

Is there any way to not delete it?

<div id="app">
  <v-app>
    <v-main>
      <v-container>
            <v-autocomplete
              :items="items"
              label="Select an item"
            ></v-autocomplete>
          </v-menu>
    </v-main>
  </v-app>
</div>




// Uses vuetify v2.x
new Vue({
  el: '#app',
  vuetify: new Vuetify(),
  data: () => ({
    items: ['foo', 'bar', 'baz', 'lorem', 'ipsum', 'something', 'else', 'to', 'make', 'itemlist', 'long']
  })
})
baceeeee
  • 27
  • 4

1 Answers1

1

I don't see any param in autocomplete api to achieve that, I suggest you to use v-combobox : https://vuetifyjs.com/en/components/combobox/

Adri
  • 240
  • 2
  • 17
  • v-combo is also auto-completed?! thank you What's the difference..? – baceeeee Aug 22 '23 at 11:27
  • According to the documentation : "The v-combobox component is a v-autocomplete that allows the user to enter values that do not exist within the provided items. Created items will be returned as strings." – Adri Aug 22 '23 at 12:55