diff --git a/apps/svelte-gravity-forms/src/lib/components/input/input.svelte b/apps/svelte-gravity-forms/src/lib/components/input/input.svelte index a75b78b..a3ed24c 100644 --- a/apps/svelte-gravity-forms/src/lib/components/input/input.svelte +++ b/apps/svelte-gravity-forms/src/lib/components/input/input.svelte @@ -25,18 +25,6 @@ )} {...attrs} bind:value={$value} - on:blur - on:change - on:click - on:focus - on:keydown - on:keypress - on:keyup - on:mouseover - on:mouseenter - on:mouseleave - on:paste - on:input use:actions.input {...$$restProps} /> diff --git a/apps/svelte-gravity-forms/src/lib/components/number/input.svelte b/apps/svelte-gravity-forms/src/lib/components/number/input.svelte index a837563..861e97e 100644 --- a/apps/svelte-gravity-forms/src/lib/components/number/input.svelte +++ b/apps/svelte-gravity-forms/src/lib/components/number/input.svelte @@ -40,8 +40,10 @@ e.preventDefault(); } } + let numericValue = writable(undefined); let inputValue = writable($value); + $: { if (!isNaN(Number($value)) && $value !== '') { $numericValue = Number($value); diff --git a/apps/svelte-gravity-forms/src/lib/components/root.svelte b/apps/svelte-gravity-forms/src/lib/components/root.svelte index aedb1d3..a53ce13 100644 --- a/apps/svelte-gravity-forms/src/lib/components/root.svelte +++ b/apps/svelte-gravity-forms/src/lib/components/root.svelte @@ -36,7 +36,6 @@ // Reset the form upon a successful result applyAction: true, invalidateAll: true, - // Reset the form upon a successful result resetForm: true, taintedMessage: null, // On ActionResult> error, render the nearest +error.svelte pages diff --git a/apps/svelte-gravity-forms/src/lib/components/select/select-native.svelte b/apps/svelte-gravity-forms/src/lib/components/select/select-native.svelte index 9cc545b..42f59bc 100644 --- a/apps/svelte-gravity-forms/src/lib/components/select/select-native.svelte +++ b/apps/svelte-gravity-forms/src/lib/components/select/select-native.svelte @@ -26,5 +26,7 @@ > - + + + diff --git a/apps/svelte-gravity-forms/src/lib/components/textarea/textarea.svelte b/apps/svelte-gravity-forms/src/lib/components/textarea/textarea.svelte index 0b24252..7a4ae01 100644 --- a/apps/svelte-gravity-forms/src/lib/components/textarea/textarea.svelte +++ b/apps/svelte-gravity-forms/src/lib/components/textarea/textarea.svelte @@ -10,7 +10,7 @@ let className: $$Props['class'] = undefined; - const { attrStore, value } = getFormField() as TextareaGetFormField; + const { attrStore, value, actions } = getFormField() as TextareaGetFormField; export { className as class }; @@ -22,17 +22,6 @@ )} {...$attrStore} bind:value={$value} - on:blur - on:change - on:click - on:focus - on:keydown - on:keypress - on:keyup - on:mouseover - on:mouseenter - on:mouseleave - on:paste - on:input + use:actions.textarea {...$$restProps} /> diff --git a/apps/svelte-gravity-forms/src/lib/internal/helpers/schema.ts b/apps/svelte-gravity-forms/src/lib/internal/helpers/schema.ts index d27af70..95e33e3 100644 --- a/apps/svelte-gravity-forms/src/lib/internal/helpers/schema.ts +++ b/apps/svelte-gravity-forms/src/lib/internal/helpers/schema.ts @@ -50,24 +50,6 @@ export function generateFormSchema(formObject: GFFormObjectProps) { fieldType = fieldType.max(Number(field.maxLength)); } - /* if (field.maxLength && Number(field.maxLength) > 0) { - fieldType = fieldType.max( - Number(field.maxLength), - `${field.label} is too long (max ${field.maxLength} characters)` - ); - } */ - - /* if (field.rangeMin && Number(field.rangeMin) > 0) { - fieldType = fieldType.min( - Number(field.rangeMin), - `${field.label} is too low (min ${field.rangeMin})` - ); - } */ - - /* if (field.rangeMax) { - fieldType = fieldType.max(10, `${field.label} is too high (max 10)`); - } */ - return { name, fieldType: fieldType