forked from Wavyzz/dolibarr
Fix query selector for array name
This commit is contained in:
@@ -1324,7 +1324,8 @@ $(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);
|
const target = $(e.target);
|
||||||
if (target && target.length) {
|
if (target && target.length) {
|
||||||
const id = target[0].id || target[0].name;
|
let id = target[0].id || target[0].name;
|
||||||
|
if (id.substr(-2) == "[]") id = id.substr(0,id.length-2);
|
||||||
document.querySelector('input[aria-controls*='+id+']').focus();
|
document.querySelector('input[aria-controls*='+id+']').focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user