Skip to content

Commit 3a64a47

Browse files
committed
Fix ChipsInput bug
1 parent 9c403dd commit 3a64a47

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

frontend/src/components/ChipsInput/ChipsInput.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ const ChipsInput: React.FC<ChipsInputProps> = ({
5959

6060
const handleSuggestionClick = (selected: string) => {
6161
onChange([...value, selected]);
62-
setInputFocused(false); // Close dropdown after selection
6362
setInputValue("");
6463
};
6564

@@ -131,7 +130,10 @@ const ChipsInput: React.FC<ChipsInputProps> = ({
131130
{filteredSuggestions.map((item, idx) => (
132131
<li
133132
key={idx}
134-
onClick={() => handleSuggestionClick(item)}
133+
onMouseDown={(e) => {
134+
e.preventDefault();
135+
handleSuggestionClick(item)
136+
}}
135137
className="px-3 py-2 cursor-pointer hover:bg-gray-100 text-sm"
136138
>
137139
{item}

0 commit comments

Comments
 (0)