Skip to content

Commit

Permalink
fix(handleSelected): ensure we're calling setVal on the right object
Browse files Browse the repository at this point in the history
Fix #51
  • Loading branch information
redox committed Dec 24, 2015
1 parent c0633e5 commit 31abbd7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/DocSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/**
Expand Down Expand Up @@ -161,8 +161,8 @@ class DocSearch {
};
}

handleSelected(event, suggestion) {
this.autocomplete.autocomplete.setVal('');

This comment has been minimized.

Copy link
@redox

redox Dec 24, 2015

Author Contributor

this was not what you expected :)

handleSelected(input, event, suggestion) {
input.setVal('');
window.location.href = suggestion.url;
}
}
Expand Down

0 comments on commit 31abbd7

Please sign in to comment.