From 8eccee030ab8a6b5e648783f769c14489429b98e Mon Sep 17 00:00:00 2001 From: Gerard Burns Date: Mon, 5 Dec 2022 14:24:53 +0000 Subject: [PATCH 1/2] Fix Skeleton Loader Jumping --- packages/client/manifest.json | 2 + .../src/components/app/forms/Form.svelte | 43 +++++++++---------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/packages/client/manifest.json b/packages/client/manifest.json index dbbb7726be..37b8cc5c8b 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -2598,6 +2598,7 @@ ] }, "passwordfield": { + "skeleton": false, "name": "Password Field", "icon": "LockClosed", "styles": [ @@ -3066,6 +3067,7 @@ ] }, "longformfield": { + "skeleton": false, "name": "Long Form Field", "icon": "TextAlignLeft", "styles": [ diff --git a/packages/client/src/components/app/forms/Form.svelte b/packages/client/src/components/app/forms/Form.svelte index 717bf00064..840c65f6bf 100644 --- a/packages/client/src/components/app/forms/Form.svelte +++ b/packages/client/src/components/app/forms/Form.svelte @@ -20,7 +20,6 @@ const context = getContext("context") const { API, fetchDatasourceSchema } = getContext("sdk") - let loaded = false let schema let table @@ -56,32 +55,30 @@ } const res = await fetchDatasourceSchema(dataSource) schema = res || {} - if (!loaded) { - loaded = true - } } $: initialValues = getInitialValues(actionType, dataSource, $context) $: resetKey = Helpers.hashString( - JSON.stringify(initialValues) + JSON.stringify(dataSource) + disabled + JSON.stringify(schema) + + JSON.stringify(initialValues) + + JSON.stringify(dataSource) + + disabled ) -{#if loaded} - {#key resetKey} - - - - {/key} -{/if} +{#key resetKey} + + + +{/key} From 0506c662666037d6e2464ca1cd8ef62e9d0dfe87 Mon Sep 17 00:00:00 2001 From: Gerard Burns Date: Mon, 5 Dec 2022 14:38:43 +0000 Subject: [PATCH 2/2] pr feedback --- packages/client/src/components/app/forms/Form.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/app/forms/Form.svelte b/packages/client/src/components/app/forms/Form.svelte index 840c65f6bf..977b940d1f 100644 --- a/packages/client/src/components/app/forms/Form.svelte +++ b/packages/client/src/components/app/forms/Form.svelte @@ -59,7 +59,7 @@ $: initialValues = getInitialValues(actionType, dataSource, $context) $: resetKey = Helpers.hashString( - JSON.stringify(schema) + + !!schema + JSON.stringify(initialValues) + JSON.stringify(dataSource) + disabled