vuetifyjs / vuetify

🐉 Vue Component Framework
https://vuetifyjs.com
MIT License
39.89k stars 6.97k forks source link

[Bug Report] Autocomplete requires multiple clicks to close menu with conditional data #4644

Closed stephen-bunn closed 6 years ago

stephen-bunn commented 6 years ago

Versions and Environment

Vuetify: 1.1.5 Vue: 2.5.16 Browsers: Google Chrome, Mozilla Firefox OS: Windows 10

Steps to reproduce

<v-autocomplete
  :items="getTypes()"
  v-model="selectedType"
></v-autocomplete>

Expected Behavior

Should close the autocomplete select menu when the item is clicked once.

Actual Behavior

Requires two clicks on the desired menu item before the menu is hidden.

Reproduction Link

https://codepen.io/stephen-bunn/pen/KBMXqW

Other comments

This previously worked fine with v-select using the autcomplete prop prior to the release of the v-autocomplete component. I'm unsure if this is intended.

johnleider commented 6 years ago

You shouldn't bind data like that. It will get reset during re-hydration. Use a computed property instead: https://codepen.io/johnjleider/pen/KBMRZK

ecmel commented 6 years ago

If server side data is used, this behavior can still be seen.

In the first selection, because of search field sync it makes another request to the server and the menu appears again.