2
0
forked from Wavyzz/dolibarr

Debug v21 - Fix set of focus on description after slection of type of

line
This commit is contained in:
Laurent Destailleur (aka Eldy)
2024-12-19 01:05:39 +01:00
parent ff2aa10145
commit 289b69bb24
6 changed files with 592 additions and 544 deletions

View File

@@ -1557,11 +1557,13 @@ if (!getDolGlobalString('MAIN_DISABLE_SELECT2_FOCUS_PROTECTION') && !defined('DI
* TODO: Recheck with the select2 GH issue and remove once this is fixed on their side
*/
$(document).on('select2:open', (e) => {
console.log("Execute the focus (click on combo or use space when on component");
console.log("Execute the focus (click on combo or use space when on component)");
const target = $(e.target);
if (target && target.length) {
let id = target[0].id || target[0].name;
if (id.substr(-2) == "[]") id = id.substr(0,id.length-2);
if (id.substr(-2) == "[]") {
id = id.substr(0,id.length-2);
}
document.querySelector('input[aria-controls*='+id+']').focus();
}
});