diff --git a/src/lib/components/input/SearchInput.svelte b/src/lib/components/input/SearchInput.svelte
index c2a641f8..4b1dea24 100644
--- a/src/lib/components/input/SearchInput.svelte
+++ b/src/lib/components/input/SearchInput.svelte
@@ -39,9 +39,11 @@
/>
diff --git a/src/lib/components/lemmy/ObjectAutocomplete.svelte b/src/lib/components/lemmy/ObjectAutocomplete.svelte
new file mode 100644
index 00000000..4d73977f
--- /dev/null
+++ b/src/lib/components/lemmy/ObjectAutocomplete.svelte
@@ -0,0 +1,54 @@
+
+
+{#if type == 'community'}
+ {
+ const results = await getClient().search({
+ q: q,
+ auth: jwt,
+ type_: 'Communities',
+ limit: 20,
+ listing_type: listing_type,
+ sort: 'TopAll',
+ })
+
+ items = results.communities.map((c) => c.community)
+ }}
+ debounceTime={600}
+ extractName={(c) => c.title}
+ bind:query={q}
+ extractSelected={(c) => {
+ if (c) dispatcher('select', c)
+ }}
+ let:extractName
+ let:extractSelected
+ let:option
+ >
+ extractSelected(option)}>
+
+
+ {option.title}
+
+ {new URL(option.actor_id).hostname}
+
+
+
+
+{/if}
diff --git a/src/lib/components/lemmy/post/PostForm.svelte b/src/lib/components/lemmy/post/PostForm.svelte
index 6ab10997..4c356395 100644
--- a/src/lib/components/lemmy/post/PostForm.svelte
+++ b/src/lib/components/lemmy/post/PostForm.svelte
@@ -14,6 +14,8 @@
import { placeholders } from '$lib/util.js'
import Checkbox from '$lib/components/input/Checkbox.svelte'
import { getSessionStorage, setSessionStorage } from '$lib/session.js'
+ import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
+ import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte'
export let edit = false
@@ -184,24 +186,12 @@
/>
{/if}
- {
- const results = await getClient().search({
- q: communitySearch,
- auth: $profile?.jwt,
- type_: 'Communities',
- limit: 20,
- listing_type: 'Subscribed',
- sort: 'Active',
- })
-
- communities = results.communities.map((c) => c.community)
- }}
- debounceTime={600}
- extractName={(c) => c.title}
- bind:query={communitySearch}
- extractSelected={(c) => {
+ {
+ const c = e.detail
if (!c) {
data.community = null
return