-
Notifications
You must be signed in to change notification settings - Fork 58
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
IsValid doesn't work when using array of objects? #115
Comments
@Zerowalker that sounds like there may well be an oversight during initialisation. It's difficult to tell, however, as it may depend on some properties passed to the form. Please provide a minimal repro - you can use this CodeSandbox: https://codesandbox.io/s/svelte-forms-lib-template-zhqs4?file=/App.svelte |
@larrybotha EDIT: forgot the link xd |
Here is another reproduction taken from the official example of array validation. I just added Codesandbox : https://codesandbox.io/s/quiet-sound-qsetv?file=/App.svelte Update : |
It is happening because of the following lines of code :
svelte-forms-lib/lib/create-form.js Lines 34 to 39 in ac8d3cb
Lines 28 to 34 in ac8d3cb
Explanation :
Solution :
I am will try to fix this problem and will create a pull request if I can. Little Side-note: This library is the best out of all the other Svelte Forms Library. |
@DhyeyMoliya |
@Zerowalker excellent, thanks for the repro - adding tests was tricky until I realised that the issue presents itself on nested arrays @DhyeyMoliya thanks for your investigation and your PR! You did all the hard work in finding the issue - much appreciated! EDIT: @DhyeyMoliya also, thanks for your kind words about |
🎉 This issue has been resolved in version 1.10.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hmm, am i missing something, or does is the array values always valid? https://codesandbox.io/s/goofy-meadow-5hf1e?file=/App.svelte EDIT: Okay i was just stupid and forgot about the initial state of the validation. |
@Zerowalker is there a UX issue that could be improved upon? |
@larrybotha UX? |
I am not sure if this is a bug, or if it's supposed to work like this, so before i give an example i want to make sure it's not on my part.
Basically if i have an array of objects, like the FormArray example, it doesn't seem to be any kind of error,
but the "isValid" will still be false.
As the FormArray example doesn't use it i can't tell if this is expected behavior or not.
The text was updated successfully, but these errors were encountered: