forked from Wavyzz/dolibarr
Debug v21 - Fix set of focus on description after slection of type of
line
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user