Skip to content

Commit

Permalink
Ignore input change events that happen when the field is blurred (#67)
Browse files Browse the repository at this point in the history
This was leading to a situation where the suggestions would show if you changed the query from outside the omnibox, since `onInputChange` fires when the query changes.
  • Loading branch information
josephschmitt authored Jun 28, 2017
1 parent 53db3b0 commit b496e81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngc-omnibox",
"version": "0.5.0",
"version": "0.5.1",
"description": "A modern, flexible, Angular 1.x autocomplete library with limited assumptions.",
"main": "dist/ngc-omnibox.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/angularComponent/ngcOmniboxController.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ export default class NgcOmniboxController {
this.hint = null;
}

if (this.canShowSuggestions({query: this.query, omnibox: this}) !== false) {
const isFieldFocused = this.doc.activeElement === this._fieldElement;
if (isFieldFocused && this.canShowSuggestions({query: this.query, omnibox: this}) !== false) {
this.updateSuggestions();
}
}
Expand Down

0 comments on commit b496e81

Please sign in to comment.