From 037353f70c357383b025fd12611db53536d6382e Mon Sep 17 00:00:00 2001 From: jairo Enrique Date: Tue, 11 Jul 2017 15:46:54 -0300 Subject: [PATCH] The component was sending the wrong integer number when selected through the key board. When the options in the autocomplete are more one, the component send the next option selected. Fixed the bug sending the position minus 1 when the list option is more than 1 option. --- src/typeahead/typeahead.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/typeahead/typeahead.js b/src/typeahead/typeahead.js index 71b807c817..87fe572474 100644 --- a/src/typeahead/typeahead.js +++ b/src/typeahead/typeahead.js @@ -423,7 +423,11 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap scope.select(scope.activeIdx, evt); }, angular.isNumber(scope.debounceUpdate) ? scope.debounceUpdate : scope.debounceUpdate['default']); } else { - scope.select(scope.activeIdx, evt); + if(scope.matches.length === 1){ + scope.select(scope.activeIdx, evt); + }else{ + scope.select(scope.activeIdx - 1 , evt); + } } }); }