From c0b9fb5eac56ebf23ee983db3be51e5725cc7ab9 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 14 Jul 2025 14:28:04 +0100 Subject: [PATCH] Handle applying suggestion without having selected one --- .../@node-red/editor-client/src/js/ui/typeSearch.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js b/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js index cf714cf20..f8855ffc2 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js @@ -293,6 +293,14 @@ RED.typeSearch = (function() { } } function confirm(def) { + if (!activeSuggestion) { + // The user has hit Enter without selecting an entry in the list. + // This means no suggestion has been shown yet - and the position recalculation + // has not been done. + // Trigger an update of the suggestion to get the position right before + // applying. + updateSuggestion(def) + } hide(); if (!def.nodes && !/^_action_:/.test(def.type)) { typesUsed[def.type] = Date.now();