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

[Types] Form onSubmit is mandatory on every package after latest release #237

Closed
plushdohn opened this issue Aug 9, 2024 · 5 comments
Closed
Assignees
Labels
question Further information is requested

Comments

@plushdohn
Copy link

The PR that fixed #219 inadvertently seems to have made the onSubmit prop in the Form component mandatory on every package.

Here's a repro with Solid
https://stackblitz.com/edit/modular-forms-solid-phgga2?file=src%2Froutes%2Flogin.tsx

Screenshot 2024-08-09 at 18 06 44

I was also able to repro on the Preact package so I guess it's the same for all (since the fix for #219 was applied everywhere)

The bug goes away when reverting to 0.22.0 instead of using the latest 0.22.1.

@plushdohn
Copy link
Author

plushdohn commented Aug 9, 2024

@fabian-hiller I know you're busy on Valibot, I'd have made a PR directly but I'm not sure how you want to tackle this since it's on every package. Is making onSubmit optional on the forms props enough? I don't know if there's a reason why it's not optional right now. In that case I'll make a PR asap.

@fabian-hiller
Copy link
Owner

Does a form without onSubmit make sense? How do you process the submission?

@fabian-hiller fabian-hiller self-assigned this Aug 10, 2024
@fabian-hiller fabian-hiller added the question Further information is requested label Aug 10, 2024
@plushdohn
Copy link
Author

Does a form without onSubmit make sense?

This is the case for every <form> element that gets enhanced implicitly by a framework. In Next.js, Remix and Solidstart you don't use onSubmit because they work with the framework's action concept instead.

I like that modular forms does it internally (which allows progressive enhancement), but a user from the outside determines the actual behaviour of the form via the action they provide to it (in both Next.js and SolidStart).

I know #3 is sort of related to this and that's a work in progress, but still I was using modular forms without a problem until I updated to 0.22.1

@fabian-hiller
Copy link
Owner

I understand. I can make it optional. In general I would like to rewrite everything to make it better and offer optimized solutions for the actions feature of every framework, but at the moment I do not have time for this.

@fabian-hiller
Copy link
Owner

A new version is available

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

No branches or pull requests

2 participants