Handle applying suggestion without having selected one

This commit is contained in:
Nick O'Leary
2025-07-14 14:28:04 +01:00
parent 8380c06a19
commit c0b9fb5eac

View File

@@ -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();