Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,12 @@ export function useActionSelectorState({
next.add(optionId);
}
} else {
next.clear();
next.add(optionId);
if (next.has(optionId)) {
next.clear();
} else {
next.clear();
next.add(optionId);
}
}
return next;
});
Expand Down Expand Up @@ -227,6 +231,9 @@ export function useActionSelectorState({

if (showSubmitButton) {
if (needsCustomInput(selected) && !isEditing) {
if (!multiSelect) {
setCheckedOptions(new Set());
}
setIsEditing(true);
} else {
toggleCheck(selected.id);
Expand Down Expand Up @@ -330,6 +337,9 @@ export function useActionSelectorState({

if (showSubmitButton) {
if (needsCustomInput(selected)) {
if (!multiSelect) {
setCheckedOptions(new Set());
}
setIsEditing(true);
} else {
toggleCheck(selected.id);
Expand Down Expand Up @@ -382,6 +392,9 @@ export function useActionSelectorState({
const next = new Set(prev);
if (value.trim()) {
if (!prev.has(selectedOption.id)) {
if (!multiSelect) {
next.clear();
}
next.add(selectedOption.id);
}
} else {
Expand All @@ -391,7 +404,7 @@ export function useActionSelectorState({
});
}
},
[showSubmitButton, selectedOption],
[showSubmitButton, selectedOption, multiSelect],
);

const ensureChecked = useCallback((optionId: string) => {
Expand Down
Loading