-
Notifications
You must be signed in to change notification settings - Fork 64
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
[Feature Request] Form
component
#369
Comments
I'm not sure this is something we want to make, since it's very tied to the schema validation type of validation. I'll leave this open if anyone wants to discuss this, but it's not on the roadmap |
@BeeMargarida, what other validations could be used in addition to schema validation? |
You can use other libraries like parsley, a lot of svelte focused ones like svelte-forms-lib (uses yup) or felte, or you can just the Constraint Validation API. Perhaps a hook that's compatible with schema validation is the way to go, if we want to include such feature in this library, but it should allow interoperability with most form validation solutions. |
This would replace those form validation solutions with a built-in one. These libraries are just ways of connecting the input fields to the validation logic. If SvelteUI provided the connection, then only the validation logic would be needed. |
Okay, I'll leave this open for now, I won't add to the roadmap for now since it's not a priority. Meanwhile, if anyone wants to pick this up and make a general solution (not only for zod), I'm all for it. |
After examining the available form validation libraries, I come to the conclusion that a custom
Form
component would be the cleanest way of form validation with SvelteUI.The
TextInput
field could integrate theon:blur
,on:change
,on:input
event handlers, thebind:value
, and theerror
message using the context API.I would recommend schema based validation with Zod. For more advanced use cases, a custom validation function could be specified.
Do you want to contribute this feature and create a pull request
Yes
The text was updated successfully, but these errors were encountered: