diff --git a/HISTORY.md b/HISTORY.md index 4a9bdf9..2bc240e 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -9,6 +9,8 @@ https://github.com/josdejong/jsoneditor - When duplicating an object property, move focus to the field and do not immediately add the ` (copy)` suffix. See #766. - Fixed #769: option `name` not working anymore. Regression since `v6.1.0`. +- Fixed #763: `autocomplete.trigger: 'focus'` throws an error when opening the + context menu. Thanks @Thaina. ## 2019-08-01, version 6.2.1 diff --git a/src/js/treemode.js b/src/js/treemode.js index 5d8f718..77ee3e5 100644 --- a/src/js/treemode.js +++ b/src/js/treemode.js @@ -1493,7 +1493,7 @@ treemode._showAutoComplete = function (element) { var self = this; setTimeout(function () { - if (self.options.autocomplete.trigger === 'focus' || element.innerText.length > 0) { + if (node && (self.options.autocomplete.trigger === 'focus' || element.innerText.length > 0)) { var result = self.options.autocomplete.getOptions(element.innerText, node.getPath(), jsonElementType, node.editor); if (result === null) { self.autocomplete.hideDropDown();