diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js index 6f0756c3e5..adbc42dde9 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js @@ -31,6 +31,7 @@ nf.PolicyManagement = (function () { var initAddTenantToPolicyDialog = function () { $('#new-policy-user-button').on('click', function () { $('#search-users-dialog').modal('show'); + $('#search-users-field').focus(); }); $('#delete-policy-button').on('click', function () { @@ -128,7 +129,7 @@ nf.PolicyManagement = (function () { handler: { close: function () { // reset the search fields - $('#search-users-field').val(''); + $('#search-users-field').userSearchAutocomplete('reset').val(''); $('#selected-user-id').text(''); } } @@ -136,6 +137,9 @@ nf.PolicyManagement = (function () { // configure the user auto complete $.widget('nf.userSearchAutocomplete', $.ui.autocomplete, { + reset: function () { + this.term = null; + }, _normalize: function (searchResults) { var items = []; items.push(searchResults); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js index 799c2cc19f..b5c9e681ac 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js @@ -103,13 +103,16 @@ nf.ClusterSearch = (function () { handler: { close: function () { // reset the search field - $('#cluster-search-field').val(config.search).addClass('search-nodes'); + $('#cluster-search-field').val(config.search).addClass('search-nodes').clusterSearchAutocomplete('reset'); } } }); // configure the cluster auto complete $.widget('nf.clusterSearchAutocomplete', $.ui.autocomplete, { + reset: function () { + this.term = null; + }, _normalize: function (searchResults) { var items = []; items.push(searchResults); @@ -134,7 +137,7 @@ nf.ClusterSearch = (function () { }, _resizeMenu: function () { var ul = this.menu.element; - ul.width(299); + ul.width($('#cluster-search-field').width() + 6); } }); @@ -171,6 +174,7 @@ nf.ClusterSearch = (function () { $('#view-single-node-link').click(function () { // hold the search nodes dialog $('#view-single-node-dialog').modal('show'); + $('#cluster-search-field').focus(); }); // handle the view cluster click event