mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Current items cleared in o2m/m2m when selecting nothing with "add existing" (#15337)
* don't update the state if nothing was selected * temp disable clearValue for relational fields Co-authored-by: Nitwel <nitwel@arcor.de>
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-if="!restricted && (defaultValue === null || !isRequired)"
|
||||
:disabled="modelValue === null"
|
||||
:disabled="modelValue === null || relational"
|
||||
clickable
|
||||
@click="$emit('update:modelValue', null)"
|
||||
>
|
||||
@@ -87,7 +87,14 @@ export default defineComponent({
|
||||
return props.field?.schema?.is_nullable === false;
|
||||
});
|
||||
|
||||
return { t, defaultValue, isRequired, isCopySupported, isPasteSupported };
|
||||
const relational = computed(
|
||||
() =>
|
||||
props.field.meta?.special?.find((type) =>
|
||||
['file', 'files', 'm2o', 'o2m', 'm2m', 'm2a', 'translations'].includes(type)
|
||||
) !== undefined
|
||||
);
|
||||
|
||||
return { t, defaultValue, isRequired, isCopySupported, isPasteSupported, relational };
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user