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

issue#103 #4

Merged
merged 1 commit into from
Jun 27, 2023
Merged

issue#103 #4

merged 1 commit into from
Jun 27, 2023

Conversation

saicheck2233
Copy link
Owner

Issue#103: Adding new item to an array doesnt show default values when Initial Data is passed

Link: Issue#103

Description: When initial data is passed, the form with array items gets loaded properly as per the initial data passed. However, when a new item is added through Add item button, the form elements are not loaded with default data provided in the schema.
This error can be simulated using following schema:

{
  "$schema": "http://json-schema.org/draft-03/schema#",
  "type": "object",
  "properties": {
    "sorts": {
      "type": "array",
      "title": "Sorting",
      "items": {
        "type": "object",
        "properties": {
          "fieldName": {
            "type": "string",
            "title": "Field name"
          },
          "ascending": {
            "type": "boolean",
            "title": "Ascending",
            "default": true
          }
        }
      }
    }
  }
}

Initial data schema used:

{
  "sorts": [
    {
      "fieldName": "test",
      "ascending": true
    }
  ]
}

Pic before changes:
image
The ascending field does not generate the default value defined in the schema, which is True.

Pic after changes:
image
Now the Ascending field would have the default value True populated.

Adding new item to an array doesnt show default values when Initial Data
 is passed
@saicheck2233 saicheck2233 merged commit 5046b4c into master Jun 27, 2023
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

Successfully merging this pull request may close these issues.

2 participants