Rearrange

This commit is contained in:
Manav Rathi
2024-09-12 09:16:05 +05:30
parent 88a0a2f9fc
commit ea46ac0196

View File

@@ -155,7 +155,7 @@ const SearchInput: React.FC<SearchInputProps> = ({
const theme = useTheme();
const styles = useMemo(() => useSelectStyles(theme), [theme]);
const components = useMemo(() => ({ Option, Control, Input }), []);
const components = useMemo(() => ({ Control, Input, Option }), []);
useEffect(() => {
search(value);
@@ -381,6 +381,16 @@ const iconForOptionType = (type: SuggestionType | undefined) => {
}
};
/**
* A custom input for react-select that is always visible.
*
* This is a workaround to allow the search string to be always displayed, and
* editable, even after the user has moved focus away from it.
*/
const Input: React.FC<InputProps<SearchOption, false>> = (props) => (
<SelectComponents.Input {...props} isHidden={false} />
);
/**
* A preflight check for whether or not we should show the EmptyState.
*
@@ -581,13 +591,3 @@ const OptionContents = ({ data }: { data: SearchOption }) => (
</Stack>
</Stack>
);
/**
* A custom input for react-select that is always visible.
*
* This is a workaround to allow the search string to be always displayed, and
* editable, even after the user has moved focus away from it.
*/
const Input: React.FC<InputProps<SearchOption, false>> = (props) => (
<SelectComponents.Input {...props} isHidden={false} />
);