diff --git a/docs/src/behavior.md b/docs/src/behavior.md index 5f7f01a2..ecb9c76b 100644 --- a/docs/src/behavior.md +++ b/docs/src/behavior.md @@ -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 , 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