Skip to content

issue#103#4

Merged
saicheck2233 merged 1 commit intomasterfrom
issue#103
Jun 27, 2023
Merged

issue#103#4
saicheck2233 merged 1 commit intomasterfrom
issue#103

Conversation

@saicheck2233
Copy link
Copy Markdown
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