-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Description
Environment
Vuetify Version: 3.11.6
Vue Version: 3.5.24
OS: Windows 10 (current)
Steps to reproduce
- Open autocomplete menu, without typing anything
- See that the first item is not selected with auto-select-first
- Type anything to filter, see that it selects the first item.
Expected Behavior
When opening the autocomplete menu, the first item should be already selected, even if nothing is typed/filtered.
This was the default behavior on v2, just migrated a big project to v3 and this issue was reported by a user, was used to just hitting enter on the first item to select it
Actual Behavior
Always auto select the first item on menu open, even if nothing was typed on the autocomplete.
Issue seems to be in this function, !isPristine check should be removed here:
const highlightFirst = computed(() => {
const selectFirst = props.autoSelectFirst === true ||
(props.autoSelectFirst === 'exact' && search.value === firstSelectableItem.value?.title)
return selectFirst &&
displayItems.value.length > 0 &&
!isPristine.value &&
!listHasFocus.value
})