From cc496925450ed9290c7185d10a9ec84ffb425885 Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 1 Oct 2021 15:10:47 +1000 Subject: [PATCH] Missed addition of 2 new js files in 7c536920 --- public/theme/backend/adminlte/select2/fix-autofocus.js | 8 ++++++++ .../theme/backend/adminlte/select2/fix-select-height.css | 3 +++ 2 files changed, 11 insertions(+) create mode 100644 public/theme/backend/adminlte/select2/fix-autofocus.js create mode 100644 public/theme/backend/adminlte/select2/fix-select-height.css diff --git a/public/theme/backend/adminlte/select2/fix-autofocus.js b/public/theme/backend/adminlte/select2/fix-autofocus.js new file mode 100644 index 0000000..94b965c --- /dev/null +++ b/public/theme/backend/adminlte/select2/fix-autofocus.js @@ -0,0 +1,8 @@ +$(document).on('select2:open',(event) => { + const searchField = document.querySelector( + `.select2-search__field[aria-controls="select2-${event.target.getAttribute('data-select2-id')}-results"]`, + ); + if (searchField) { + searchField.focus(); + } +}); diff --git a/public/theme/backend/adminlte/select2/fix-select-height.css b/public/theme/backend/adminlte/select2/fix-select-height.css new file mode 100644 index 0000000..59f4e8b --- /dev/null +++ b/public/theme/backend/adminlte/select2/fix-select-height.css @@ -0,0 +1,3 @@ +.select2-selection.select2-selection--single { + height: calc(2.25rem + 2px) !important; +}