diff --git a/components/judges/TeamSelect.tsx b/components/judges/TeamSelect.tsx index 03fe84f9..4dca5d2a 100644 --- a/components/judges/TeamSelect.tsx +++ b/components/judges/TeamSelect.tsx @@ -20,6 +20,18 @@ function withCheckMark(value: string) { ); } + +const optionComparator = (input: string, option: string) => { + let searchPosition = 0; + const cin = input.toLowerCase(); + const opt = option.toLowerCase(); + for (let i = 0; i < opt.length; ++i) { + if (opt[i] === cin[searchPosition]) ++searchPosition; + else break; + } + return searchPosition === input.length; +}; + export default function TeamSelect(props: TeamSelectProps) { const { teamsData, currentTeamID, handleChange } = props; const { data: session } = useSession(); @@ -34,10 +46,12 @@ export default function TeamSelect(props: TeamSelectProps) { Team: