preventing the last item to be unselected (#15873)
Fix https://github.com/twentyhq/twenty/issues/15867
This commit is contained in:
+3
@@ -147,6 +147,9 @@ export const SettingsMorphRelationMultiSelect = ({
|
||||
const addOrRemoveFromArray = (array: string[], item: string) => {
|
||||
let newArray = new Set(array);
|
||||
if (newArray.has(item)) {
|
||||
if (newArray.size <= 1) {
|
||||
return array;
|
||||
}
|
||||
newArray.delete(item);
|
||||
} else {
|
||||
newArray.add(item);
|
||||
|
||||
Reference in New Issue
Block a user