diff --git a/packages/core/src/components/MultiSelect/MultiSelect.tsx b/packages/core/src/components/MultiSelect/MultiSelect.tsx index 248f2e3c4..bcf9ed383 100644 --- a/packages/core/src/components/MultiSelect/MultiSelect.tsx +++ b/packages/core/src/components/MultiSelect/MultiSelect.tsx @@ -59,7 +59,7 @@ export const MultiSelect: FC & WithStyle = React.memo( setInputValue(value); const newOptions = filterOptions(options, value); newOptions.length && value ? setOptions(newOptions) : updateToDefaultOptions(); - !areOptionsVisible && showOptions(); + !areOptionsVisible && setOptionsVisibilityState(true); }, [areOptionsVisible, options, updateToDefaultOptions] ), diff --git a/packages/core/src/components/SingleSelect/SingleSelect.tsx b/packages/core/src/components/SingleSelect/SingleSelect.tsx index 5d1c95aae..0a0fa2c9d 100644 --- a/packages/core/src/components/SingleSelect/SingleSelect.tsx +++ b/packages/core/src/components/SingleSelect/SingleSelect.tsx @@ -47,9 +47,9 @@ export const SingleSelect: FC & WithStyle = React.memo( const showOptions = useCallback(() => { setOptionsVisibilityState(true); - inputRef.current.setSelectionRange && inputRef.current.setSelectionRange(inputValue.length, inputValue.length); + isSearchable && setInputValue(''); inputRef.current.focus(); - }, [inputValue]), + }, [isSearchable, inputValue]), hideOptions = useCallback(() => { setOptionsVisibilityState(false); inputRef.current && inputRef.current.blur(); @@ -64,7 +64,7 @@ export const SingleSelect: FC & WithStyle = React.memo( newOptions = filterOptions(getUpdatedOptions(defaultOptions, selectedOption), target.value); setInputValue(target.value); newOptions.length && target.value ? setOptions(newOptions) : updateToDefaultOptions(); - !areOptionsVisible && showOptions(); + !areOptionsVisible && setOptionsVisibilityState(true); }, [areOptionsVisible, defaultOptions, selectedOption, updateToDefaultOptions] ),