mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Fix handling of spacebar inside JSON visual editor
Fixes #3682 The treeList keyboard handling was consuming the event - used to select the item in the list. The fix here adds a 'selectable' flag on the treeList that can be used to disabled (=false) the keyboard selection of items.
This commit is contained in:
parent
7d7682b34e
commit
e3d6d242ac
@ -21,6 +21,7 @@
|
||||
* - multi : boolean - if true, .selected will return an array of results
|
||||
* otherwise, returns the first selected item
|
||||
* - 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
|
||||
* false, prevents items being sorted to the
|
||||
* top level of the tree
|
||||
@ -118,6 +119,7 @@
|
||||
switch(evt.keyCode) {
|
||||
case 32: // SPACE
|
||||
case 13: // ENTER
|
||||
if (!that.options.selectable) { return }
|
||||
if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) {
|
||||
return
|
||||
}
|
||||
|
@ -534,6 +534,7 @@
|
||||
var container = $("#red-ui-editor-type-json-tab-ui-container").css({"height":"100%"});
|
||||
var filterDepth = Infinity;
|
||||
var list = $('<div class="red-ui-debug-msg-payload red-ui-editor-type-json-editor">').appendTo(container).treeList({
|
||||
selectable: false,
|
||||
rootSortable: false,
|
||||
sortable: ".red-ui-editor-type-json-editor-item-handle",
|
||||
}).on("treelistchangeparent", function(event, evt) {
|
||||
|
Loading…
Reference in New Issue
Block a user