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

user can now remove items if minItem is set #264

Merged
merged 1 commit into from
Feb 28, 2020
Merged

Conversation

kkz6164
Copy link
Contributor

@kkz6164 kkz6164 commented Feb 25, 2020

Fixed a bug where when editing a jsonform with an array type, if the minItems was set and the initial node.children.length >= minItems, it did not allow the user to remove from that array.

Fixed a bug where when editing a jsonform with an array type, if the minItems was set and the initial node.children.length >= minItems, it did not allow the user to remove from that array.
@kkz6164
Copy link
Contributor Author

kkz6164 commented Feb 25, 2020

An example that recreates the issue. I have set the minItems to 1, and there are already 3 friends within the array, but I cannot remove them:

{
  "schema": {
    "friends": {
      "type": "tabarray",
      "minItems": 1,
      "items": {
        "type": "object",
        "title": "Friend",
        "properties": {
          "nick": {
            "type": "string",
            "title": "Nickname",
            "required": true
          },
          "gender": {
            "type": "string",
            "title": "Gender",
            "enum": [ "male", "female", "alien" ]
          },
          "age": {
            "type": "integer",
            "title": "Age"
          }
        }
      }
    }
  },
   "value": {
    "friends": [
      { "nick": "tidoust", "gender": "male", "age": 34 },
      { "nick": "titine", "gender": "female", "age": 6 },
      { "nick": "E.T.", "gender": "alien" }
    ]
  }
}

@tchapi tchapi merged commit 43b2aac into jsonform:master Feb 28, 2020
@tchapi
Copy link
Member

tchapi commented Feb 28, 2020

Nice catch, thanks @kkz6164 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants