resolves #588 and avoid wrong comment
This commit is contained in:
parent
6a929a1f84
commit
3bf0e3e770
1 changed files with 5 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue