From 31abbd7400bbf89026d7db0848f2be448090a530 Mon Sep 17 00:00:00 2001 From: Sylvain UTARD Date: Thu, 24 Dec 2015 10:20:15 +0100 Subject: [PATCH] fix(handleSelected): ensure we're calling setVal on the right object Fix #51 --- src/lib/DocSearch.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/DocSearch.js b/src/lib/DocSearch.js index a1bdf050..e280c637 100644 --- a/src/lib/DocSearch.js +++ b/src/lib/DocSearch.js @@ -58,7 +58,7 @@ class DocSearch { footer: templates.footer } }]); - this.autocomplete.on('autocomplete:selected', this.handleSelected); + this.autocomplete.on('autocomplete:selected', this.handleSelected.bind(null, this.autocomplete.autocomplete)); } /** @@ -161,8 +161,8 @@ class DocSearch { }; } - handleSelected(event, suggestion) { - this.autocomplete.autocomplete.setVal(''); + handleSelected(input, event, suggestion) { + input.setVal(''); window.location.href = suggestion.url; } }