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

fix issue when boolean of type checkbox used in array with format table #809

Closed
wants to merge 2 commits into from

Conversation

oguzgelal
Copy link

When boolean with checkbox format is used in an array with table format, following error occurs:

Uncaught TypeError: Cannot read property 'insertBefore' of undefined
    at e.getFormControl (jsoneditor.min.js.php:631)
    at e.build (jsoneditor.min.js.php:627)
    at jsoneditor.min.js.php:361
    at d (jsoneditor.min.js.php:64)
    at e.build (jsoneditor.min.js.php:361)
    at e.getElementEditor (jsoneditor.min.js.php:488)
    at e.addRow (jsoneditor.min.js.php:506)
    at jsoneditor.min.js.php:494
    at d (jsoneditor.min.js.php:64)
    at e.setValue (jsoneditor.min.js.php:492)

To reproduce, from the demo page:

  1. Select HTML from the CSS Framework dropdown (the issue isn't reproducible on bootstrap themes, because they have their own implementation of the faulty method, the abstract theme file has the faulty implementation)

  2. Use below schema:

{
  "title": "Test",
  "type": "object",
  "properties": {
    "pets": {
      "type": "array",
      "format": "table",
      "items": {
        "type": "object",
        "title": "Pet",
        "properties": {
          "visible": {
            "type": "boolean",
            "format": "checkbox"
          }
        }
      }
    }
  }
}
  1. Add a new item to the array

@oguzgelal oguzgelal closed this Mar 22, 2021
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.

1 participant