mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
FIX ability to disable forcing focus on select2 to avoid side effects
This commit is contained in:
@@ -1299,6 +1299,9 @@ $(document).ready(function() {
|
||||
*
|
||||
* TODO: Recheck with the select2 GH issue and remove once this is fixed on their side
|
||||
*/
|
||||
<?php
|
||||
if (empty($conf->global->MAIN_DISABLE_SELECT2_FOCUS_PROTECTION) && !defined('DISABLE_SELECT2_FOCUS_PROTECTION')) {
|
||||
?>
|
||||
$(document).on('select2:open', () => {
|
||||
console.log("Execute the focus (click on combo or use space when on component");
|
||||
let allFound = document.querySelectorAll('.select2-container--open .select2-search__field');
|
||||
@@ -1308,5 +1311,6 @@ $(document).on('select2:open', () => {
|
||||
},0);
|
||||
});
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
// End of lib_head.js.php
|
||||
|
||||
Reference in New Issue
Block a user