diff --git a/app/soapbox/components/autosuggest-account-input.tsx b/app/soapbox/components/autosuggest-account-input.tsx index 9aebe9f6f..352be593b 100644 --- a/app/soapbox/components/autosuggest-account-input.tsx +++ b/app/soapbox/components/autosuggest-account-input.tsx @@ -71,6 +71,12 @@ const AutosuggestAccountInput: React.FC = ({ } }; + useEffect(() => { + if (rest.autoFocus) { + handleAccountSearch(''); + } + }, []); + useEffect(() => { if (value === '') { clearResults(); diff --git a/app/soapbox/features/chats/components/chat-search/chat-search.tsx b/app/soapbox/features/chats/components/chat-search/chat-search.tsx index 43fa95361..c3ee19982 100644 --- a/app/soapbox/features/chats/components/chat-search/chat-search.tsx +++ b/app/soapbox/features/chats/components/chat-search/chat-search.tsx @@ -31,7 +31,7 @@ const ChatSearch = () => { const { isOpen, changeScreen, toggleChatPane } = useChatContext(); const { getOrCreateChatByAccountId } = useChats(); - const [value, setValue] = useState(); + const [value, setValue] = useState(''); const debouncedValue = debounce(value as string, 300); const { data: accounts, isFetching } = useAccountSearch(debouncedValue);