Skip to content

Commit 258fe2b

Browse files
committed
Hide moremenu when the user presses enter
Mobile users rejoice!
1 parent 136e9de commit 258fe2b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/ui/moremenu.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,15 @@ export default function MoreMenu({ profileLinks, sort, setSort, query, setQuery
9090
<input
9191
value={query}
9292
onChange={(e) => setQuery(e.target.value)}
93+
onKeyDown={(e) => {
94+
if (e.key === 'Enter') {
95+
setOpen(false);
96+
(e.target as HTMLInputElement).blur();
97+
}
98+
}}
9399
placeholder="Search…"
94100
className="w-full rounded-md bg-neutral-800 px-3 py-1.5 text-sm placeholder:text-neutral-500 focus:outline-none focus:ring-2 focus:ring-amber-500"
101+
enterKeyHint="search"
95102
/>
96103
</div>
97104

0 commit comments

Comments
 (0)