File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -80,10 +80,19 @@ function triggerFocusOnFirstInputField(firstField) {
8080 * @param {jQuery} firstField
8181 */
8282 function handleFocusOnSelect2Field (firstField ){
83- $ (' .select2-search__field' ).remove ();
8483 firstField .select2 (' focus' );
8584 }
8685
86+ /*
87+ * Hacky fix for a bug in select2 with jQuery 3.6.0's new nested-focus "protection"
88+ * see: https://github.com/select2/select2/issues/5993
89+ * see: https://github.com/jquery/jquery/issues/4382
90+ *
91+ */
92+ $ (document ).on (' select2:open' , () => {
93+ setTimeout (() => document .querySelector (' .select2-container--open .select2-search__field' ).focus (), 100 );
94+ });
95+
8796 jQuery (' document' ).ready (function ($ ){
8897
8998 // trigger the javascript for all fields that have their js defined in a separate method
You can’t perform that action at this time.
0 commit comments