diff --git a/web/src/ui.tsx b/web/src/ui.tsx index fc86a82..29488be 100644 --- a/web/src/ui.tsx +++ b/web/src/ui.tsx @@ -158,6 +158,14 @@ export function Combobox({ create && filter && !exact && !disabled ? create(query.trim()) : []; const total = shown.length + creations.length; const cursor = active < total ? active : -1; + // The dropdown scrolls at 264px; keep the armed row visible while + // arrowing through a long category list. + useEffect(() => { + if (cursor < 0) return; + document + .getElementById(`${listID}-${cursor}`) + ?.scrollIntoView({ block: "nearest" }); + }, [cursor, listID]); const pick = (v: string) => { onChange(v); setOpen(false);