diff --git a/src/lib/components/refactor/ComposerForm.svelte b/src/lib/components/refactor/ComposerForm.svelte
index cd1c04b..343769f 100644
--- a/src/lib/components/refactor/ComposerForm.svelte
+++ b/src/lib/components/refactor/ComposerForm.svelte
@@ -105,6 +105,16 @@
handleNext();
}
}
+ let childInput;
+ $: {
+ childInput = {
+ form,
+ errors,
+ validate,
+ field: fields[$state.context.currentField],
+ constraints
+ };
+ }
@@ -124,61 +134,19 @@
{/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')}
diff --git a/src/lib/components/refactor/inputfields/NumberInput.svelte b/src/lib/components/refactor/inputfields/NumberInput.svelte
index 249bf99..8373447 100644
--- a/src/lib/components/refactor/inputfields/NumberInput.svelte
+++ b/src/lib/components/refactor/inputfields/NumberInput.svelte
@@ -1,17 +1,15 @@
- import { writable } from 'svelte/store';
+ import { onMount } from 'svelte';
- export let form;
- export let errors;
- export let validate;
- export let field;
- export let constraints;
+ let inputElement;
- const state = writable('');
+ export let childInput;
+
+ const { form, errors, field, constraints } = childInput;
+
+ onMount(() => {
+ inputElement.focus();
+ });