Skip to content

Data are copying instead of move when using navigation button and remove_empty_properties = true #1033

@santanurite

Description

@santanurite

Hi Guys, first of all this is great plugin.

I was working on json schema with using "remove_empty_properties" : true property.
After using this property = true when I click the navigation button UP/DOWN then it will copy the previous item to next one instead just moving.
Not sure the exact cause but when I removed this property (remove_empty_properties) then it will work like what should be (just move the values up or down)

  • json-editor version: 2.5.4

Expected behavior

Data should be moved instead of copying when using remove_empty_properties = true

Actual behavior

Data copying the previous or the next entry when using navigation button

Steps to reproduce the behavior

Here is the link of json editor
https://json-editor.github.io/json-editor/?data=N4Ig9gDgLglmB2BnEAuUMDGCA2MBGqIAZglAIYDuApomALZUCsIANOHgFZUZQD62ZAJ5gArlELwwAJzplsrEIgwALKrNShYUbFUIAFKlEQACAKIAPMnQg6FUQRF0p2XHgohTIVKbBoaQjkb+9o6EZFJSQgokMmTizuR4tmxats4GQWwwUGrIaCAhTi7c4inZaSAZCpCwCHmgUmpgAG5UvGrQgrweXj4wfihQUiJUAL5sPY59A5oOTrOhzohDMPAA5gpU8CJ0qADaIBhxCgAmYBtseDBSJwqN0DDJ4FCqUiAAumwnVERkItjxEBnDbjEDwKzzApzQjLKSrEGjUHfX7/eJ7BZFYEKcEMQgAdTkOTeo3eiNBiGUYAo7Qi0jyIFWRLIPDg8DsqlxzjwYDARiGZAgABYQIigA

The schema I using

{
  "title": "Pets Example",
  "type": "object",
  "properties": {
    "pets": {
      "type": "array",
      "format": "table",
      "title": "Pets",
      "items": {
        "type": "object",
        "title": "Pet",
     "options": {
         "remove_empty_properties": true
      },
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "cat",
              "dog",
              "bird",
              "reptile",
              "other"
            ],
            "default": "dog"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "default": [
        {
          "type": "dog",
          "name": "Walter"
        }
      ]
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions