Single element on focus type for searching without clicking

Hi,
I need the following for select single

when user use key tab an arrive on the select2 dropdown the person must be able to enter the search value directly without the need of a click, use enter key or space key to open the search
At the moment the user need to click on the field then enter the value to search.

This seems possible only when using multiple but not on single
See this example
https://select2.org/appearance#labels

Hi,

I found this solution
I have tested with jQuery v3.5.1 and Select2 v4.0.13
It not working with jQuery v3.6.0+

$(document).on('focus', '.select2-selection.select2-selection--single', function (e) {
  $(this).closest(".select2-container").siblings('select:enabled').select2('open');
});

$('select.select2').on('select2:closing', function (e) {
  $(e.target).data("select2").$selection.one('focus focusin', function (e) {
    e.stopPropagation();
  });
});

Ref

Summary

https://stackoverflow.com/questions/20989458/select2-open-dropdown-on-focus

I saw many issues with focus ans jQuery v3.6.0+ so I’m not sure if there is a solution and how to apply it to this example.