Merge pull request #8934 from Budibase/fix-skeleton-jank

Fix Skeleton Loader Jumping
This commit is contained in:
Andrew Kingston 2022-12-05 18:12:16 +00:00 committed by GitHub
commit 93df5aaf33
2 changed files with 22 additions and 23 deletions

View File

@ -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": [

View File

@ -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
!!schema +
JSON.stringify(initialValues) +
JSON.stringify(dataSource) +
disabled
)
</script>
{#if loaded}
{#key resetKey}
<InnerForm
{dataSource}
{theme}
{size}
{disabled}
{actionType}
{schema}
{table}
{initialValues}
{disableValidation}
{editAutoColumns}
>
<slot />
</InnerForm>
{/key}
{/if}
{#key resetKey}
<InnerForm
{dataSource}
{theme}
{size}
{disabled}
{actionType}
{schema}
{table}
{initialValues}
{disableValidation}
{editAutoColumns}
>
<slot />
</InnerForm>
{/key}