minor Form fixes
This commit is contained in:
parent
d3d181d625
commit
3b0640875e
@ -72,7 +72,13 @@
|
|||||||
},
|
},
|
||||||
submitting: {
|
submitting: {
|
||||||
on: {
|
on: {
|
||||||
SUBMIT: 'submitted'
|
SUBMIT: 'submitted',
|
||||||
|
PREV: {
|
||||||
|
target: 'input',
|
||||||
|
actions: assign({
|
||||||
|
currentField: (context) => context.currentField - 1
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
submitted: {
|
submitted: {
|
||||||
@ -119,6 +125,7 @@
|
|||||||
|
|
||||||
<div class="p-6">
|
<div class="p-6">
|
||||||
<form on:submit|preventDefault={handleNext} on:keydown={handleKeyDown} class="w-full max-w-md">
|
<form on:submit|preventDefault={handleNext} on:keydown={handleKeyDown} class="w-full max-w-md">
|
||||||
|
{#if !$state.matches('submitting')}
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
{#if $errors[fields[$state.context.currentField].name]}
|
{#if $errors[fields[$state.context.currentField].name]}
|
||||||
<span class="block mb-2 font-semibold text-red-500">
|
<span class="block mb-2 font-semibold text-red-500">
|
||||||
@ -149,6 +156,7 @@
|
|||||||
<NumberInput {childInput} />
|
<NumberInput {childInput} />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
{#if $state.matches('submitting')}
|
{#if $state.matches('submitting')}
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<h2 class="text-lg font-semibold text-white">Summary</h2>
|
<h2 class="text-lg font-semibold text-white">Summary</h2>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user