From 267c1747f4bc7747e98b4467a5dd5036d88c0976 Mon Sep 17 00:00:00 2001 From: Joyce <26967919+Joyce-O@users.noreply.github.com> Date: Mon, 2 Feb 2026 14:12:27 -0500 Subject: [PATCH] update --- frontend/src/components/ParticipantSelector.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/ParticipantSelector.tsx b/frontend/src/components/ParticipantSelector.tsx index 11e0b7a..65575a1 100644 --- a/frontend/src/components/ParticipantSelector.tsx +++ b/frontend/src/components/ParticipantSelector.tsx @@ -41,11 +41,14 @@ export const ParticipantSelector = ({ const addParticipant = useCallback((participant: Participant) => { onSelectionChange([...selectedParticipants, participant]); setSearchQuery(''); - setHighlightedIndex(0); - setIsDropdownOpen(false); - // Re-focus input after selection + // Keep dropdown open for multi-select; clamp highlight to new list length + setHighlightedIndex((prev) => { + const newLength = filteredParticipants.length - 1; + return prev >= newLength ? Math.max(0, newLength - 1) : prev; + }); + // Keep focus on input so user can continue selecting requestAnimationFrame(() => inputRef.current?.focus()); - }, [onSelectionChange, selectedParticipants]); + }, [onSelectionChange, selectedParticipants, filteredParticipants.length]); const handleKeyDown = (e: React.KeyboardEvent) => { if (!isDropdownOpen || filteredParticipants.length === 0) return; -- 2.49.1