[ ] Before posting an issue, read the FAQ and search the previous issues.
Description
With a form, I have a component like so:
<script context="module" lang="ts">
import type { FormPathLeaves } from 'sveltekit-superforms';
type T = Record<string, unknown>;
type U = unknown;
</script>
<script generics="T extends Record<string, unknown>, U extends FormPathLeaves<T, number>" lang="ts">
import { numberProxy, fieldProxy, type SuperForm } from 'sveltekit-superforms';
export let form: SuperForm<T>;
export let name: U;
const proxy = numberProxy(form, name, { empty: 'zero', initiallyEmptyIfZero: true });
</script>
<input {name} {...$$restProps} type="number" bind:value={$proxy} />
However, when I restore from a snapshot, the field resolves to the default zod value rather than the cached value. fieldProxy works correctly and shows the right value
Description With a form, I have a component like so:
However, when I
restore
from a snapshot, the field resolves to the default zod value rather than the cached value.fieldProxy
works correctly and shows the right valueIf applicable, a MRE Use this template project to create a minimal reproducible example that you can link to here: https://sveltelab.dev/github.com/ciscoheat/superforms-examples/tree/zod (right click to open in a new tab)