diff --git a/app/soapbox/features/compose/components/search.tsx b/app/soapbox/features/compose/components/search.tsx index 9c1aab765..ec7c89468 100644 --- a/app/soapbox/features/compose/components/search.tsx +++ b/app/soapbox/features/compose/components/search.tsx @@ -115,27 +115,34 @@ const Search = (props: ISearch) => { ]; const hasValue = value.length > 0 || submitted; - const Component = autosuggest ? AutosuggestAccountInput : 'input'; + const componentProps: any = { + className: 'block w-full pl-3 pr-10 py-2 border border-gray-200 dark:border-gray-800 rounded-full leading-5 bg-gray-200 dark:bg-gray-800 dark:text-white placeholder:text-gray-600 dark:placeholder:text-gray-600 focus:outline-none focus:ring-2 focus:ring-primary-500 sm:text-sm', + type: 'text', + id: 'search', + placeholder: intl.formatMessage(messages.placeholder), + value, + onChange: handleChange, + onKeyDown: handleKeyDown, + onFocus: handleFocus, + autoFocus: autoFocus, + }; + + if (autosuggest) { + componentProps.onSelected = handleSelected; + componentProps.menu = makeMenu(); + componentProps.autoSelect = false; + } return (
- + {autosuggest ? ( + + ) : ( + + )}