1
0
Fork 0

better management of selector matching plenty element, we only take the first one

This commit is contained in:
s-pace 2018-11-02 10:03:22 +01:00
parent b211630cc2
commit 67b64d60ec

View file

@ -184,9 +184,13 @@ class DocSearch {
} else {
const selectors = selector.split(',');
if (selectors.length === 1) {
return [$(selector).filter('input')];
const input = $(selector).filter('input');
return input.length ? [$(input[0])] : null;
} else {
return selectors.map(s => $(s).filter('input'));
return selectors.map(s => {
const input = $(s).filter('input');
return input.length ? $(input[0]) : null;
});
}
}
}