diff --git a/packages/ui/select/src/Select.tsx b/packages/ui/select/src/Select.tsx index de4d8ac00..94f355e96 100644 --- a/packages/ui/select/src/Select.tsx +++ b/packages/ui/select/src/Select.tsx @@ -186,12 +186,11 @@ 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 + const { keyCode } = evt - if (key === 'Enter' && !isComposing) { + if (keyCode === 13) { const item = showData[focusedIndex] if (item) { @@ -236,12 +235,6 @@ 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)}