1
0
Fork 0

resolves #588 and avoid wrong comment

This commit is contained in:
s-pace 2019-01-22 22:43:06 +01:00 committed by Sylvain Pace
parent 6a929a1f84
commit 3bf0e3e770

View file

@ -53,19 +53,19 @@ The method is called with the following arguments:
docsearch({
[…],
handleSelected: function(input, event, suggestion, datasetNumber, context) {
// Do nothing if click on the suggestion, as it's already a <a href>, the
// browser will take care of it. This allow Ctrl-Clicking on results and not
// having the main window being redirected as well
if (context.selectionMethod === 'click') {
//Your own logic
return;
}
input.setVal('');
window.location.assign(suggestion.url);
}
});
```
When a custom `handleSelected` is set, default browser clicks on suggestions are
disabled and only `handleSelected` is called.
## `queryHook`
This method is called on every keystroke to transform the typed keywords before