mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
FIX Add a hack to fix a bug in jquery 3.6.0/select 2
This commit is contained in:
@@ -1198,4 +1198,22 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
* 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
|
||||
* see: https://github.com/jquery/jquery/issues/4382
|
||||
*
|
||||
* TODO: Recheck with the select2 GH issue and remove once this is fixed on their side
|
||||
*/
|
||||
$(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');
|
||||
$(this).one('mouseup keyup',()=>{
|
||||
setTimeout(()=>{
|
||||
allFound[allFound.length - 1].focus();
|
||||
},0);
|
||||
});
|
||||
});
|
||||
|
||||
// End of lib_head.js.php
|
||||
|
||||
Reference in New Issue
Block a user