Skip to content

Commit

Permalink
fix: autofocus on search field in ACP > Manage > Plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Feb 3, 2021
1 parent 44019e2 commit 4af9c2f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions public/src/admin/extend/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ define('admin/extend/plugins', [
return;
}

$('#plugin-search').val('');
const searchInputEl = document.querySelector('#plugin-search');
searchInputEl.value = '';

pluginsList.on('click', 'button[data-action="toggleActive"]', function () {
var pluginEl = $(this).parents('li');
Expand Down Expand Up @@ -147,7 +148,7 @@ define('admin/extend/plugins', [
});
});

$('#plugin-search').on('input propertychange', function () {
$(searchInputEl).on('input propertychange', function () {
var term = $(this).val();
$('.plugins li').each(function () {
var pluginId = $(this).attr('data-plugin-id');
Expand Down Expand Up @@ -226,6 +227,7 @@ define('admin/extend/plugins', [

populateUpgradeablePlugins();
populateActivePlugins();
searchInputEl.focus();
};

function confirmInstall(pluginID, callback) {
Expand Down

0 comments on commit 4af9c2f

Please sign in to comment.