better management of selector matching plenty element, we only take the first one
This commit is contained in:
parent
b211630cc2
commit
67b64d60ec
1 changed files with 6 additions and 2 deletions
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue