From 80cc83d2f07947ed78a9ecb0b71c3edd0f9f7225 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 20 Mar 2024 15:42:28 +0000 Subject: [PATCH] Fix huge amount of wasted renders by observing entire component context when generating form block fields --- .../client/src/components/app/blocks/form/FormBlock.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/app/blocks/form/FormBlock.svelte b/packages/client/src/components/app/blocks/form/FormBlock.svelte index 8c084a71ab..d249569731 100644 --- a/packages/client/src/components/app/blocks/form/FormBlock.svelte +++ b/packages/client/src/components/app/blocks/form/FormBlock.svelte @@ -34,6 +34,7 @@ $: formattedFields = convertOldFieldFormat(fields) $: fieldsOrDefault = getDefaultFields(formattedFields, schema) $: fetchSchema(dataSource) + $: id = $component.id // We could simply spread $$props into the inner form and append our // additions, but that would create svelte warnings about unused props and // make maintenance in future more confusing as we typically always have a @@ -53,7 +54,7 @@ buttons: buttons || Utils.buildFormBlockButtonConfig({ - _id: $component.id, + _id: id, showDeleteButton, showSaveButton, saveButtonLabel,