diff --git a/packages/components/select-v2/src/useAllowCreate.ts b/packages/components/select-v2/src/useAllowCreate.ts index bd5f466d566cd..1ec803821b8c1 100644 --- a/packages/components/select-v2/src/useAllowCreate.ts +++ b/packages/components/select-v2/src/useAllowCreate.ts @@ -58,7 +58,14 @@ export function useAllowCreate(props: ISelectProps, states) { } function removeNewOption(option: Option) { - if (!enableAllowCreateMode.value || !option || !option.created) { + if ( + !enableAllowCreateMode.value || + !option || + !option.created || + (option.created && + props.reserveKeyword && + states.inputValue === option.label) + ) { return } const idx = states.createdOptions.findIndex( diff --git a/packages/components/select-v2/src/useSelect.ts b/packages/components/select-v2/src/useSelect.ts index 8c2c18b8e9f0a..55b70bf4eda8c 100644 --- a/packages/components/select-v2/src/useSelect.ts +++ b/packages/components/select-v2/src/useSelect.ts @@ -591,7 +591,10 @@ const useSelect = (props: ExtractPropTypes, emit) => { const onKeyboardSelect = () => { if (!expanded.value) { return toggleMenu() - } else if (~states.hoveringIndex) { + } else if ( + ~states.hoveringIndex && + filteredOptions.value[states.hoveringIndex] + ) { onSelect( filteredOptions.value[states.hoveringIndex], states.hoveringIndex,