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

Keep order of fields when updating a JSON object #926

Closed
josdejong opened this issue Mar 7, 2020 · 1 comment
Closed

Keep order of fields when updating a JSON object #926

josdejong opened this issue Mar 7, 2020 · 1 comment
Labels

Comments

@josdejong
Copy link
Owner

Currently, when you've loaded an object like the following in tree mode:

{
  "one": 1,
  "three": 3
}

and afterwards update this object to the following using editor.update(...):

{
  "one": 1,
  "two": 2,
  "three": 3
}

The new property "two" is added at the end of the rendered fields instead of inserted in the middle: you get the order "one", "three", "two".

It would be neat if the newly added field is inserted in the middle instead, maintaining order of the keys.

For reference: #891 (comment)

@josdejong
Copy link
Owner Author

This is fixed now in jsoneditor@8.6.2 and web application v5.3.3.

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