From 6ee7ae953d9c23a1931ed8d0311f3a340d1bf7d2 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Mon, 6 Nov 2023 13:56:31 +0000 Subject: [PATCH] Don't trigger required validation early --- .../client/src/components/app/forms/RelationshipField.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/app/forms/RelationshipField.svelte b/packages/client/src/components/app/forms/RelationshipField.svelte index 544a1a8434..2c567c49aa 100644 --- a/packages/client/src/components/app/forms/RelationshipField.svelte +++ b/packages/client/src/components/app/forms/RelationshipField.svelte @@ -137,7 +137,9 @@ typeof value === "object" ? value._id : value ) // Make sure field state is valid - fieldApi.setValue(values) + if (values?.length > 0) { + fieldApi.setValue(values) + } return values }