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 Report][3.6.8] VAutocomplete with auto-select-first selects highlighted option even when clicked outside #19929

Comments

@eric-pa
Copy link

eric-pa commented May 31, 2024

Environment

Vuetify Version: 3.6.8
Vue Version: 3.4.27
Browsers: Google Chrome
OS: Linux

Steps to reproduce

  1. Type anything that highlights an option
  2. Click outside of the component

Expected Behavior

Same as when aborted via ESC. Not select the highlighted option but keep the search text.

Actual Behavior

Option is selected like it was clicked despite it was not clicked. This can even be reproduced in the docs:
https://vuetifyjs.com/en/components/autocompletes/#new-tab

Reproduction Link

https://play.vuetifyjs.com/#...

@dnasir
Copy link

dnasir commented Sep 13, 2024

Sorry for reviving this issue, but the description for auto-select-first says:

When searching, will always highlight the first option and select it on blur. exact will only highlight and select exact matches.

I added the emphasis on blur. The blur event is fired the input element loses focus. This can occur when the user Escapes, Tabs, or clicks away from the input field. So either the description is wrong, or the implementation is wrong, or there's confusion on what the blur event means in this context.

@eric-pa
Copy link
Author

eric-pa commented Sep 13, 2024

I guess the description is wrong as it doesn't make much sense to select something on a blur event like ESC.

@KaelWD
Copy link
Member

KaelWD commented Sep 17, 2024

Yeah I don't think this was a bug @yuwu9145, only escape should cancel selection: #13788

@dnasir
Copy link

dnasir commented Sep 18, 2024

@KaelWD I sort of understand the reasoning behind the fix. Like, how do you "escape" on mobile? But you can always just turn off auto-select-first for mobile if you don't want this behaviour.

@KaelWD
Copy link
Member

KaelWD commented Sep 19, 2024

Ok yeah I could see that for combobox because you still need a way to enter a custom value, autocomplete only allows you to select something from the list though so "just keep the search" doesn't really make sense.

@dnasir
Copy link

dnasir commented Nov 12, 2024

So will this change be reverted, or will the documentation be updated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment