Skip to content

Commit 24b39be

Browse files
committed
fix: prevent setting of two "Unset" options in select for create/edit views
1 parent 1ed1962 commit 24b39be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adminforth/spa/src/components/ColumnValueInput.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ const input = ref<HTMLInputElement | null>(null);
224224
const formatSelectOptions = (options: any, column: any) => {
225225
const optionsToReturn = options;
226226
if (!column.required[props.mode] && !column.isArray?.enabled) {
227-
optionsToReturn.push({ label: t('Unset'), value: null });
227+
if (!optionsToReturn.some((option: any) => option.value === null)) {
228+
optionsToReturn.push({ label: t('Unset'), value: null });
229+
}
228230
}
229231
return optionsToReturn;
230232
};

0 commit comments

Comments
 (0)