diff options
Diffstat (limited to 'public/javascripts/search.js')
-rw-r--r-- | public/javascripts/search.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/public/javascripts/search.js b/public/javascripts/search.js index 3f223ec..a07d6dd 100644 --- a/public/javascripts/search.js +++ b/public/javascripts/search.js @@ -13,13 +13,14 @@ self._nodes = { } self.submit = function () { - self._nodes.input.blur() - document.body.classList.remove('week-selector-not-visible') // Safari bug - const selectedItem = autocomplete.getSelectedItem() + if (selectedItem == null) return console.log(selectedItem) + self._nodes.input.blur() + document.body.classList.remove('week-selector-not-visible') // Safari bug + self.emit('search', selectedItem) } |