From e3863ec5937f9a28d91fb614fbc8a6b69ce9f783 Mon Sep 17 00:00:00 2001 From: Ryan Rombough Date: Mon, 4 May 2015 18:36:26 -0600 Subject: [PATCH] adding logic to run onSelect function if user hits "enter" key within the input box without highlighting a selection first --- script/autocomplete.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/autocomplete.js b/script/autocomplete.js index 377ad0f..498d5f1 100644 --- a/script/autocomplete.js +++ b/script/autocomplete.js @@ -221,6 +221,9 @@ app.directive('autocomplete', function() { } else { if(keycode == key.enter) { scope.select(); + if(scope.onSelect) { + scope.onSelect(scope.searchParam); + } } } scope.setIndex(-1);