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

Add support for form arrays #401

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

unlocomqx
Copy link

@unlocomqx unlocomqx commented Apr 7, 2024

Fixes #396

Currently, it's not possible to add new forms after component init because life hooks functions are being called when a form is created

This PR moves calls to life hooks outside the superForm function

Test page
http://localhost:5173/v2/multiple-forms

Copy link

vercel bot commented Apr 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
superforms ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2024 9:11pm

When form.id is reassigned during Svelte's derived phase, ERR_SVELTE_UNSAFE_MUTATION is thrown.

It's because it can lead to unexpected errors and possibly cause infinite loops
@ciscoheat
Copy link
Owner

Thank you, do the latest commits fix the message problem, or is it something I have to take a closer look at?

@unlocomqx
Copy link
Author

unlocomqx commented Apr 12, 2024

Yes, the each key fix resolved the messages issue

Thank you

@ciscoheat
Copy link
Owner

Nice work, hopefully I can add this to the next release!

@unlocomqx
Copy link
Author

I'll be glad to see it in any release if it's stable and doesn't cause any trouble :))

@ciscoheat
Copy link
Owner

As mentioned in #396, this has to wait until later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Usability problem of an array of superforms
2 participants