$(document).on("focus",'.select2-selection--multiple',function(){
$(".select2-search__field").focus();
});
when I use this error getting "too much recursion" in firefox and "Uncaught RangeError: maximum call stack size exceeded" in chrome.
<span class="select2 select2-container select2-container--default" dir="ltr" style="width: 100px;">
<span class="selection">
<span class="select2-selection select2-selection--multiple" role="combobox" aria-autocomplete="list" aria-haspopup="true" aria-expanded="false" tabindex="0">
<ul class="select2-selection__rendered">
<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" placeholder="" style="width: 0.75em;"></li>
</ul>
</span>
</span>
<span class="dropdown-wrapper" aria-hidden="true"></span>
</span>
this is my html, I actually use the selec2 plugin and try to focus on when I click on the tab.
Aabid source
share