3 Commits

Author SHA1 Message Date
7a0f11ee88 Merge pull request 'Improve participant selection' (#5) from more-improvements-autofocus into main
Reviewed-on: #5
2026-02-02 19:13:08 +00:00
Joyce
267c1747f4 update 2026-02-02 14:12:27 -05:00
9412d5c0a0 Merge pull request 'imporvements' (#4) from implement-feedback into main
Reviewed-on: #4
2026-02-02 18:52:36 +00:00

View File

@@ -41,11 +41,14 @@ export const ParticipantSelector = ({
const addParticipant = useCallback((participant: Participant) => { const addParticipant = useCallback((participant: Participant) => {
onSelectionChange([...selectedParticipants, participant]); onSelectionChange([...selectedParticipants, participant]);
setSearchQuery(''); setSearchQuery('');
setHighlightedIndex(0); // Keep dropdown open for multi-select; clamp highlight to new list length
setIsDropdownOpen(false); setHighlightedIndex((prev) => {
// Re-focus input after selection 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()); requestAnimationFrame(() => inputRef.current?.focus());
}, [onSelectionChange, selectedParticipants]); }, [onSelectionChange, selectedParticipants, filteredParticipants.length]);
const handleKeyDown = (e: React.KeyboardEvent) => { const handleKeyDown = (e: React.KeyboardEvent) => {
if (!isDropdownOpen || filteredParticipants.length === 0) return; if (!isDropdownOpen || filteredParticipants.length === 0) return;