Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,9 @@ export const VAutocomplete = genericComponent<new <
}

function onBlur (e: FocusEvent) {
const menuContent = vMenuRef.value?.contentEl
if (menuContent?.contains(e.relatedTarget as Node)) {
isFocused.value = true
const target = e.target as Element
if (!vTextFieldRef.value?.$el.contains(target)) {
menu.value = false
}
}

Expand Down Expand Up @@ -417,7 +417,6 @@ export const VAutocomplete = genericComponent<new <
nextTick(() => isSelecting.value = false)
} else {
if (!props.multiple && search.value == null) model.value = []
menu.value = false
if (!isPristine.value && search.value) {
_searchLock.value = search.value
}
Expand Down Expand Up @@ -538,7 +537,6 @@ export const VAutocomplete = genericComponent<new <
filterable
selected={ selectedValues.value }
selectStrategy={ props.multiple ? 'independent' : 'single-independent' }
onMousedown={ (e: MouseEvent) => e.preventDefault() }
onFocusout={ onFocusout }
tabindex="-1"
selectable={ !!displayItems.value.length }
Expand Down
8 changes: 3 additions & 5 deletions packages/vuetify/src/components/VCombobox/VCombobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -469,17 +469,16 @@ export const VCombobox = genericComponent<new <
}

function onBlur (e: FocusEvent) {
const menuContent = vMenuRef.value?.contentEl
if (menuContent?.contains(e.relatedTarget as Node)) {
isFocused.value = true
const target = e.target as Element
if (!vTextFieldRef.value?.$el.contains(target)) {
menu.value = false
}
}

watch(isFocused, (val, oldVal) => {
if (val || val === oldVal) return

selectionIndex.value = -1
menu.value = false

if (search.value) {
if (props.multiple) {
Expand Down Expand Up @@ -601,7 +600,6 @@ export const VCombobox = genericComponent<new <
filterable
selected={ selectedValues.value }
selectStrategy={ props.multiple ? 'independent' : 'single-independent' }
onMousedown={ (e: MouseEvent) => e.preventDefault() }
selectable={ !!displayItems.value.length }
onFocusout={ onFocusout }
tabindex="-1"
Expand Down
Loading