diff --git a/packages/ui/select/src/Select.tsx b/packages/ui/select/src/Select.tsx index 1e5379334..de4d8ac00 100644 --- a/packages/ui/select/src/Select.tsx +++ b/packages/ui/select/src/Select.tsx @@ -186,11 +186,12 @@ export const Select = forwardRef( const defaultIndex = showData.findIndex((item: SelectDataItem) => !item.disabled) const [focusedIndex, setFocusedIndex] = useState(defaultIndex) + const [isComposing, setIsComposing] = useState(false) const handleKeyDown = useLatestCallback((evt: React.KeyboardEvent) => { const { key } = evt - if (key === 'Enter') { + if (key === 'Enter' && !isComposing) { const item = showData[focusedIndex] if (item) { @@ -235,6 +236,12 @@ export const Select = forwardRef( onKeyDown={mockDefaultHandlers(handleKeyDown, onKeyDownProp)} onOpen={menuVisibleAction.on} onClose={menuVisibleAction.off} + onCompositionStart={() => { + setIsComposing(true) + }} + onCompositionEnd={() => { + setIsComposing(false) + }} searchable={searchable} keyword={keywordProp} onSearch={callAllFuncs(onSearchProp, onSearch)}