diff --git a/frontend/src/lib/components/DataInput/DataInput.svelte b/frontend/src/lib/components/DataInput/DataInput.svelte index 09edb483..2c214c91 100644 --- a/frontend/src/lib/components/DataInput/DataInput.svelte +++ b/frontend/src/lib/components/DataInput/DataInput.svelte @@ -13,6 +13,7 @@ export let textTrigger: string = 'noAdditionalText'; export let showTextField: boolean = false; export let additionalInput: any = null; + export let disabled: boolean = false; // data to display and event handlers for dynamcis. export let properties: any = {}; @@ -53,6 +54,7 @@ $: valid = evalValid(value); $: highlight = !valid && properties.required === true; $: showTextField = checkShowTextfield(value); + $: console.log('disabled field: ', disabled); {#if label} @@ -62,8 +64,9 @@
@@ -27,6 +28,7 @@ {#each $$props.items as item, index} { + console.log('onmount'); const currentUser = await usersCurrentUser(); if (currentUser.error) { @@ -135,10 +137,20 @@ console.log('data from backend: ', 'currentAnswers: ', currentAnswers?.data); for (let i = 0; i < data.length; i++) { data[i].value = currentAnswers.data[i].answer; + data[i].disabled = true; + dataIsCurrent = true; } } } + console.log('onmount done'); + reload = true; }); + console.log( + 'data: ', + data.map((e) => { + e.value; + }) + ); @@ -182,17 +194,19 @@ }} /> {/each} - {#if currentDataSubmitted === true} + {#if dataIsCurrent === true} {:else}