Skip to content

A free open source IT asset/license management system

get desired behavior of select-2

Godfrey Mbe5c5a51dac2
diff --git a/resources/views/hardware/bulk-checkout.blade.php b/resources/views/hardware/bulk-checkout.blade.php
index 03c49218f5..c637b51834 100644
--- a/resources/views/hardware/bulk-checkout.blade.php
+++ b/resources/views/hardware/bulk-checkout.blade.php
@@ -146,6 +146,21 @@
});
$('#assigned_assets_select').select2('open');
+ setTimeout(function () {
+ const $searchField = $('.select2-search__field');
+ const $results = $('.select2-results');
+
+ // Focus the search input
+ $searchField.focus();
+
+ // Hide results initially
+ $results.hide();
+
+ // Show results when a user starts typing
+ $searchField.on('input', function () {
+ $results.show();
+ });
+ }, 0);
});
</script>