Add missing initial form values to form context and prefix static values to avoid clashes with column names
This commit is contained in:
parent
de7caf90f4
commit
be22834d47
|
@ -1739,15 +1739,15 @@
|
|||
"values": [
|
||||
{
|
||||
"label": "Valid",
|
||||
"key": "valid"
|
||||
"key": "__valid"
|
||||
},
|
||||
{
|
||||
"label": "Current Step",
|
||||
"key": "currentStep"
|
||||
"key": "__currentStep"
|
||||
},
|
||||
{
|
||||
"label": "Current Step Valid",
|
||||
"key": "currentStepValid"
|
||||
"key": "__currentStepValid"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -256,17 +256,20 @@
|
|||
{ type: ActionTypes.ClearForm, callback: formApi.clear },
|
||||
{ type: ActionTypes.ChangeFormStep, callback: formApi.changeStep },
|
||||
]
|
||||
|
||||
// Create data context to provide
|
||||
$: dataContext = {
|
||||
...initialValues,
|
||||
...$values,
|
||||
|
||||
// These static values are prefixed to avoid clashes with actual columns
|
||||
__valid: valid,
|
||||
__currentStep: $currentStep,
|
||||
__currentStepValid: $currentStepValid,
|
||||
}
|
||||
</script>
|
||||
|
||||
<Provider
|
||||
{actions}
|
||||
data={{
|
||||
...$values,
|
||||
valid,
|
||||
currentStep: $currentStep,
|
||||
currentStepValid: $currentStepValid,
|
||||
}}
|
||||
>
|
||||
<Provider {actions} data={dataContext}>
|
||||
<div use:styleable={$component.styles}>
|
||||
<slot />
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue