Skip to content

Commit 31abbd7

Browse files
committed
fix(handleSelected): ensure we're calling setVal on the right object
Fix #51
1 parent c0633e5 commit 31abbd7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/lib/DocSearch.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class DocSearch {
5858
footer: templates.footer
5959
}
6060
}]);
61-
this.autocomplete.on('autocomplete:selected', this.handleSelected);
61+
this.autocomplete.on('autocomplete:selected', this.handleSelected.bind(null, this.autocomplete.autocomplete));
6262
}
6363

6464
/**
@@ -161,8 +161,8 @@ class DocSearch {
161161
};
162162
}
163163

164-
handleSelected(event, suggestion) {
165-
this.autocomplete.autocomplete.setVal('');
164+
handleSelected(input, event, suggestion) {
165+
input.setVal('');
166166
window.location.href = suggestion.url;
167167
}
168168
}

0 commit comments

Comments
 (0)