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

Ensure an item in action list is always selected

This commit is contained in:
Nick O'Leary 2019-06-22 20:25:57 +01:00
parent 8c68e76c3e
commit a73c159160
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -49,6 +49,10 @@ RED.actionList = (function() {
filterTerm = $(this).val();
searchResults.editableList('filter');
searchResults.find("li.selected").removeClass("selected");
var children = searchResults.children(":visible");
if (children.length) {
$(children[0]).addClass('selected');
}
}
});
@ -61,7 +65,6 @@ RED.actionList = (function() {
var children = searchResults.children(":visible");
if (children.length) {
$(children[0]).addClass('selected');
RED.a = children[0];
}
} else {
var nextChild = selectedChild.nextAll(":visible").first();
@ -162,6 +165,10 @@ RED.actionList = (function() {
visible = true;
}
searchInput.trigger("focus");
var children = searchResults.children(":visible");
if (children.length) {
$(children[0]).addClass('selected');
}
}
function hide() {