diff --git a/src/lib/components/refactor/ComposerForm.svelte b/src/lib/components/refactor/ComposerForm.svelte index 343769f..950fdc8 100644 --- a/src/lib/components/refactor/ComposerForm.svelte +++ b/src/lib/components/refactor/ComposerForm.svelte @@ -72,7 +72,13 @@ }, submitting: { on: { - SUBMIT: 'submitted' + SUBMIT: 'submitted', + PREV: { + target: 'input', + actions: assign({ + currentField: (context) => context.currentField - 1 + }) + } } }, submitted: { @@ -119,36 +125,38 @@
-
- {#if $errors[fields[$state.context.currentField].name]} - - {$errors[fields[$state.context.currentField].name]} - - {:else} - - {/if} - {#if fields[$state.context.currentField].type === 'text'} - - {:else if fields[$state.context.currentField].type === 'email'} - - {:else if fields[$state.context.currentField].type === 'textarea'} - - {:else if fields[$state.context.currentField].type === 'select'} - - {:else if fields[$state.context.currentField].type === 'slider'} - - {:else if fields[$state.context.currentField].type === 'toggle'} - - {:else if fields[$state.context.currentField].type === 'number'} - - {/if} -
+ {#if !$state.matches('submitting')} +
+ {#if $errors[fields[$state.context.currentField].name]} + + {$errors[fields[$state.context.currentField].name]} + + {:else} + + {/if} + {#if fields[$state.context.currentField].type === 'text'} + + {:else if fields[$state.context.currentField].type === 'email'} + + {:else if fields[$state.context.currentField].type === 'textarea'} + + {:else if fields[$state.context.currentField].type === 'select'} + + {:else if fields[$state.context.currentField].type === 'slider'} + + {:else if fields[$state.context.currentField].type === 'toggle'} + + {:else if fields[$state.context.currentField].type === 'number'} + + {/if} +
+ {/if} {#if $state.matches('submitting')}

Summary