diff --git a/packages/components/_private/selector/src/composables/useInputState.ts b/packages/components/_private/selector/src/composables/useInputState.ts index 3a20278db..16a7511f6 100644 --- a/packages/components/_private/selector/src/composables/useInputState.ts +++ b/packages/components/_private/selector/src/composables/useInputState.ts @@ -40,10 +40,6 @@ export function useInputState(props: SelectorProps, mergedSearchable: ComputedRe } const handleBlur = (evt: FocusEvent) => { - if (props.allowInput && !props.multiple) { - props.value[0] = inputValue.value - inputValue.value = '' - } isFocused.value = false callEmit(props.onBlur, evt) } diff --git a/packages/components/select/src/Select.tsx b/packages/components/select/src/Select.tsx index 42b47e9ff..2a48554b5 100644 --- a/packages/components/select/src/Select.tsx +++ b/packages/components/select/src/Select.tsx @@ -107,7 +107,13 @@ export default defineComponent({ } } - const handleBlur = () => accessor.markAsBlurred() + const handleBlur = () => { + if (props.allowInput && inputValue.value) { + changeSelected(inputValue.value) + clearInput() + } + accessor.markAsBlurred() + } const handleItemRemove = (value: VKey) => { focus() handleRemove(value)