1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge pull request #3687 from node-red/space-in-strings

Fix handling of spacebar inside JSON visual editor
This commit is contained in:
Nick O'Leary 2022-06-17 10:05:12 +01:00 committed by GitHub
commit fc5a5f1b73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -21,6 +21,7 @@
* - multi : boolean - if true, .selected will return an array of results * - multi : boolean - if true, .selected will return an array of results
* otherwise, returns the first selected item * otherwise, returns the first selected item
* - sortable: boolean/string - TODO: see editableList * - sortable: boolean/string - TODO: see editableList
* - selectable: boolean - default true - whether individual items can be selected
* - rootSortable: boolean - if 'sortable' is set, then setting this to * - rootSortable: boolean - if 'sortable' is set, then setting this to
* false, prevents items being sorted to the * false, prevents items being sorted to the
* top level of the tree * top level of the tree
@ -118,6 +119,7 @@
switch(evt.keyCode) { switch(evt.keyCode) {
case 32: // SPACE case 32: // SPACE
case 13: // ENTER case 13: // ENTER
if (!that.options.selectable) { return }
if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) { if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) {
return return
} }

View File

@ -534,6 +534,7 @@
var container = $("#red-ui-editor-type-json-tab-ui-container").css({"height":"100%"}); var container = $("#red-ui-editor-type-json-tab-ui-container").css({"height":"100%"});
var filterDepth = Infinity; var filterDepth = Infinity;
var list = $('<div class="red-ui-debug-msg-payload red-ui-editor-type-json-editor">').appendTo(container).treeList({ var list = $('<div class="red-ui-debug-msg-payload red-ui-editor-type-json-editor">').appendTo(container).treeList({
selectable: false,
rootSortable: false, rootSortable: false,
sortable: ".red-ui-editor-type-json-editor-item-handle", sortable: ".red-ui-editor-type-json-editor-item-handle",
}).on("treelistchangeparent", function(event, evt) { }).on("treelistchangeparent", function(event, evt) {