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

Nested array, last element controls surfaced data #357

Open
1 of 5 tasks
drewcovi opened this issue Mar 11, 2024 · 0 comments
Open
1 of 5 tasks

Nested array, last element controls surfaced data #357

drewcovi opened this issue Mar 11, 2024 · 0 comments

Comments

@drewcovi
Copy link

drewcovi commented Mar 11, 2024

Describe the bug
which template:

  • MaterialDesignFrameworkModule — Material Design
  • Bootstrap3FrameworkModule — Bootstrap 3
  • Bootstrap4FrameworkModule — Bootstrap 4
  • NoFrameworkModule — plain HTML
  • Other (please specify below)

When providing one or multiple nested arrays, it would appears any data prepoulation is limited by the number of fields in the last parent item array.

To Reproduce

  1. Paste the JSON provided and observe the child results across both parent instances.
  2. Adjust the child items in the second parent instance.
  3. Notice that both parents will always have identical children items driven by the second parent whether or not they are prepopulated.

Expected behavior
Both parents should have different prepopulated data based on the provided data.

Screenshots

With layout

with-layout
{
    "schema": {
        "properties": {
            "parents": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "children": {
                            "type": "array",
                            "items": {
                                "type": "number"
                            }
                        }
                    }
                }
            }
        }
    },
    "data": {
            "parents": [
                {
                    "children": [
                        1,
                        2,
                        3,
                        4
                    ]
                },
                {
                    "children": [
                        4
                    ]
                }
            ]
        },
    "layout": [
        {
            "key": "parents",
            "items": [
                    {
                        "key": "parents[].children",
                        "items": [
                            {
                                "key": "parents[].children[]"
                            }
                        ]
                    }
        ]}
    ]
}

Without Layout

without-layout
{
    "schema": {
        "properties": {
            "parents": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "children": {
                            "type": "array",
                            "items": {
                                "type": "number"
                            }
                        }
                    }
                }
            }
        }
    },
    "data": {
            "parents": [
                {
                    "children": [
                        1,
                        2,
                        3,
                        4
                    ]
                },
                {
                    "children": [
                        4
                    ]
                }
            ]
        }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant