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
Checkboxgroup is not working as expected in the SmartForm #1998
Comments
OK, I see the issue now. It's a bit tricky to fix, I need to think about it… |
@SachaG So where does this bug come from ? Did it appear with the Smartform rework from last month ? |
Yes it was because of the rewrite. You can see how I fixed it in the linked commit. |
The label of the checkboxgroup is disappeared, and the 'null' value causes the validation error if the data type is 'String'. |
Yes, I can confirm that it's broken on the current devel. It works on the master branch though (v1.11.2). I don't know what could have broken this, I did not read the latest commits |
Add < label >{inputProperties.label}< /label > to the beginning of the < div >< /div > could add the label back. |
I fixed the missing label. The null value thing is trickier, let me think about it… |
So the root issue is deciding whether the array containing the checkbox values can be "sparse" or not, i.e. With nested forms (like in the address example) it's important to preserve empty array items because we rely on paths to update other items – so if we delete the first item, we don't want the For checkboxes though it makes less sense, so maybe we shouldn't be using that same system at all and just handle the entire checkbox array's state inside the checkbox group component instead. |
That should hopefully fix it. It was actually a lot simpler than I thought (assuming it actually works now!). |
Actually this is still not fixed because when going from |
OK now I think it works! |
I tried with the "example-forum" in the latest "Vulcan-Starter" repo, I could add the new category, but could not remove the checked category from the "Edit Post" after submitting the form.
The text was updated successfully, but these errors were encountered: