diff --git a/HISTORY.md b/HISTORY.md index f76ed51..8cfa66f 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,6 +3,12 @@ https://github.com/josdejong/jsoneditor +## not yet released, version 5.5.5 + +- Fixed enum drop downs not working when the JSONEditor is configured with + a name. + + ## 2016-05-22, version 5.5.4 - Fixed #285: an issue with the enum drop down when having defined multiple diff --git a/src/js/Node.js b/src/js/Node.js index 7df5b34..d929848 100644 --- a/src/js/Node.js +++ b/src/js/Node.js @@ -80,9 +80,11 @@ Node.prototype.getPath = function () { var node = this; var path = []; while (node) { - var field = (!node.parent || node.parent.type != 'array') - ? node.field - : node.index; + var field = !node.parent + ? undefined // do not add an (optional) field name of the root node + : (node.parent.type != 'array') + ? node.field + : node.index; if (field !== undefined) { path.unshift(field);