From b242acca4d0be85a59a42555bd811cb18d22372b Mon Sep 17 00:00:00 2001 From: "yupan.zhang" Date: Mon, 15 Jan 2018 16:39:03 +0800 Subject: [PATCH] if the propertyOrder undefined, then set a smart default value. --- src/editors/object.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/editors/object.js b/src/editors/object.js index 22410db84..67734b67a 100644 --- a/src/editors/object.js +++ b/src/editors/object.js @@ -638,6 +638,10 @@ JSONEditor.defaults.editors.object = JSONEditor.AbstractEditor.extend({ } var schema = self.getPropertySchema(name); + if(typeof schema.propertyOrder !== 'number'){ + // if the propertyOrder undefined, then set a smart default value. + schema.propertyOrder = Object.keys(self.editors).length + 1000; + } // Add the property