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

ensure input box has focus on repeated quick add

This commit is contained in:
Dave Conway-Jones 2019-05-30 14:33:11 +01:00
parent dc75a5812f
commit 22855279bd
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4

View File

@ -47,7 +47,7 @@ RED.typeSearch = (function() {
function createDialog() { function createDialog() {
dialog = $("<div>",{id:"red-ui-type-search",class:"red-ui-search red-ui-type-search"}).appendTo("#red-ui-main-container"); dialog = $("<div>",{id:"red-ui-type-search",class:"red-ui-search red-ui-type-search"}).appendTo("#red-ui-main-container");
var searchDiv = $("<div>",{class:"red-ui-search-container"}).appendTo(dialog); var searchDiv = $("<div>",{class:"red-ui-search-container"}).appendTo(dialog);
searchInput = $('<input type="text" id="red-ui-type-search-input">').attr("placeholder",RED._("search.addNode")).appendTo(searchDiv).searchBox({ searchInput = $('<input type="text" id="red-ui-type-search-input" autofocus>').attr("placeholder",RED._("search.addNode")).appendTo(searchDiv).searchBox({
delay: 50, delay: 50,
change: function() { change: function() {
search($(this).val()); search($(this).val());
@ -283,7 +283,7 @@ RED.typeSearch = (function() {
function refreshTypeList(opts) { function refreshTypeList(opts) {
var i; var i;
searchResults.editableList('empty'); searchResults.editableList('empty');
searchInput.searchBox('value',''); searchInput.searchBox('value','').focus();
selected = -1; selected = -1;
var common = [ var common = [
'inject','debug','function','change','switch' 'inject','debug','function','change','switch'