diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 96f2fe24274..20f1d81846b 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -1334,6 +1334,9 @@ jQuery(document).ready(function() { }); +global->MAIN_DISABLE_SELECT2_FOCUS_PROTECTION) && !defined('DISABLE_SELECT2_FOCUS_PROTECTION')) { + ?> /* * Hacky fix for a bug in select2 with jQuery 3.6.0's new nested-focus "protection" * see: https://github.com/select2/select2/issues/5993 @@ -1342,9 +1345,6 @@ jQuery(document).ready(function() { * TODO: Recheck with the select2 GH issue and remove once this is fixed on their side */ -global->MAIN_DISABLE_SELECT2_FOCUS_PROTECTION) && !defined('DISABLE_SELECT2_FOCUS_PROTECTION')) { - ?> $(document).on('select2:open', (e) => { console.log("Execute the focus (click on combo or use space when on component"); const target = $(e.target);