Closed SanderKok01 closed 5 months ago
This is not possible right now, and would probably add quite a bit of complexity to the component, so I'd have to carefully consider the best way to implement it.
It's a bit tricky, because strictly speaking object properties don't have an "order", and it's only through JS implementation details that key order is mostly preserved at all. (For example, if you save a JSON field as binary in a Postgres database, the order is completely ignored, and will be alphabetized on next read).
For now, the only way to change the order (other than deleting and re-adding keys) is to edit the JSON directly and move it around as text:
I've created an issue to consider key ordering more generally, so will definitely be thinking about it further: https://github.com/CarlosNZ/json-edit-react/issues/73
@SanderKok01, I've started playing round with a basic drag-n-drop. I should have something for you to try out next week some time. :)
You can now do basic drag-n-drop in v1.13.1: https://www.npmjs.com/package/json-edit-react/v/1.13.1
Let me know how it goes :)
Amazing, thank you!
Hello,
I'd like to be able to re-order properties. Drag and drop one above the other. Is this possible?