Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onUpdated not trigged #540

Closed
1 task
spidi123q opened this issue Dec 24, 2024 · 1 comment
Closed
1 task

onUpdated not trigged #540

spidi123q opened this issue Dec 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@spidi123q
Copy link

  • Before posting an issue, read the FAQ and search the previous issues.

I started my codebase with svelte 4 and following code worked fine for my client side validated form but after recent svelte 5 migration onUpdated no longer trigged but onUpdate is trigged.
Any help is appreciated

package.json

 "svelte": "^5.15.0"
"sveltekit-superforms": "^2.22.1",
"zod": "^3.23.8"
    "formsnap": "^1.0.1",
const form = superForm<any>(
    inboxAutomation
      ? {
          ...inboxAutomation,
        }
      : {
          name: "Untitled",
          messages_tree: {...InitialInboxAutomationMessageNode}
        },
    {
      SPA: true,
      resetForm: false,
      dataType: "json",
      validators: zodValidator(inboxAutomationSchema),
      onUpdated: async ({ form: f }) => {
        console.log("🚀 ~ onUpdated: ~ f:", f)
        if (f.valid) {
          try {
            //return submitAutomation(f.data);
          } catch (e) {
            console.log("error", e);
          }
        } else {
          console.log("form is invalid", f.errors);
         
          }
        }
      },
    },
  );
@spidi123q spidi123q added the bug Something isn't working label Dec 24, 2024
@ciscoheat
Copy link
Owner

Duplicate of #536

@ciscoheat ciscoheat marked this as a duplicate of #536 Dec 26, 2024
@ciscoheat ciscoheat closed this as not planned Won't fix, can't repro, duplicate, stale Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants