-
Notifications
You must be signed in to change notification settings - Fork 556
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
Array: reordering is buggy #9
Comments
The commit fixes the reordering issues, but values in nested array are still lost during reordering for the time being.
@tidoust Thanks a lot! Any time estimate on fixing "values in nested array Thanks! |
@huyl, hopefully I'll be able to find some time this week to fix the remaining issue. The main bug to fix lies in the |
I've been looking at AngularJS and I think it could be a great framework for implementing jsonform in such a way that the generated Check out this demo with sortable drag-n-drop elements in an arbitrarily deep tree: http://jsfiddle.net/huyz/x8Y2F/3/ Note that the underlying JSON will be kept in sync at all times, which is something that I need for my application (because the generated JSON is actually a form specification which I need to preview in real-time to implement a sort of wysiwig UI) |
The "getPreviousNumberOfItems" function uses "truncateToArrayDepth" to shorten the path to a key to the right depth level and then compute the number of items at the level in previously submitted values. That second function did not return all the properties up to the next array level, meaning the value checked in previously submitted values could well be an object and not an array. For instance, given a path: "foo.bar[].baz.stuff.blah[].thing" the function used to return "foo.bar[]" for a depth of 1. It now returns: "foo.bar[].baz.stuff.blah" This should fix issue #9
@huyl, closing the issue as I fixed the buggy |
In
playground/?example=fields-array
if you add a top-level element and then re-order, one item disappears.Then if you add second-level elements and just keep playing around, you get top-level elements at the second level.
Etc.
The text was updated successfully, but these errors were encountered: