diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js index 2dbd6d71a..0401be1b9 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js @@ -15,7 +15,7 @@ **/ (function($) { var contextParse = function(v,defaultStore) { - var parts = RED.utils.parseContextKey(v, defaultStore); + var parts = RED.utils.parseContextKey(v, defaultStore&&defaultStore.value); return { option: parts.store, value: parts.key @@ -279,6 +279,14 @@ var contextStores = RED.settings.context.stores; var contextOptions = contextStores.map(function(store) { return {value:store,label: store, icon:''} + }).sort(function(A,B) { + if (A.value === RED.settings.context.default) { + return -1; + } else if (B.value === RED.settings.context.default) { + return 1; + } else { + return A.value.localeCompare(B.value); + } }) if (contextOptions.length < 2) { allOptions.flow.options = [];