show exact match

This commit is contained in:
Lars Nolden
2026-09-11 15:18:09 +02:00
parent 5a4937afe4
commit 41af06f718
+6 -1
View File
@@ -849,7 +849,12 @@ function InstitutionSelect({
const matches = (institutions ?? []).filter((i) =>
i.name.toLowerCase().includes(filter),
);
const shown = matches.slice(0, 60);
const exact = filter
? matches.find((i) => i.name.toLowerCase() === filter)
: undefined;
const shown = exact
? [exact, ...matches.filter((i) => i !== exact).slice(0, 59)]
: matches.slice(0, 60);
const selected = institutions?.find((i) => i.name === value);
return (
<Field