From ab6d537c3ee526367104315b8ad2f767e3ffc0ae Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 5 Sep 2023 17:49:50 +0100 Subject: [PATCH] Default filter to All Catalogues and show nodes for small lists --- .../@node-red/editor-client/src/js/ui/palette-editor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/palette-editor.js b/packages/node_modules/@node-red/editor-client/src/js/ui/palette-editor.js index 7999cce1c..8d3815749 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/palette-editor.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/palette-editor.js @@ -494,6 +494,7 @@ RED.palette.editor = (function() { // if there is only 1 catalog, hide the select if (catalogEntries.length > 1) { catalogSelection.prepend(``) + catalogSelection.val('all') catalogSelection.removeAttr('disabled') // permit the user to select a catalog } // refresh the searchInput counter and trigger a change @@ -523,7 +524,7 @@ RED.palette.editor = (function() { function refreshFilteredItems() { packageList.editableList('empty'); var currentFilter = searchInput.searchBox('value').trim(); - if (currentFilter === ""){ + if (currentFilter === "" && loadedList.length > 20){ packageList.editableList('addItem',{count:loadedList.length}) return; } @@ -893,7 +894,7 @@ RED.palette.editor = (function() { delay: 300, change: function() { var searchTerm = $(this).val().trim().toLowerCase(); - if (searchTerm.length > 0) { + if (searchTerm.length > 0 || loadedList.length < 20) { filteredList = loadedList.filter(function(m) { return (m.index.indexOf(searchTerm) > -1); }).map(function(f) { return {info:f}});