Compare commits
3 Commits
implement-
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 7a0f11ee88 | |||
|
|
267c1747f4 | ||
| 9412d5c0a0 |
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user