From 861391aa8accc649765fca804445a09f249da2b1 Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Thu, 7 Jan 2016 17:08:56 -0800 Subject: [PATCH] fix(typeahead): use correct selector - With the addition of the header, the selector to scroll the dropdown onto the correct element is incorrect - this fixes it to select all list elements in the dropdown --- src/typeahead/typeahead.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/typeahead/typeahead.js b/src/typeahead/typeahead.js index 8be9507e7e..05c5f9954f 100644 --- a/src/typeahead/typeahead.js +++ b/src/typeahead/typeahead.js @@ -46,7 +46,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap var isEditable = originalScope.$eval(attrs.typeaheadEditable) !== false; originalScope.$watch(attrs.typeaheadEditable, function (newVal) { isEditable = newVal !== false; - }); + }); //binding to a variable that indicates if matches are being retrieved asynchronously var isLoadingSetter = $parse(attrs.typeaheadLoading).assign || angular.noop; @@ -394,12 +394,12 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap case 38: scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1; scope.$digest(); - popUpEl.children()[scope.activeIdx].scrollIntoView(false); + popUpEl.find('li')[scope.activeIdx].scrollIntoView(false); break; case 40: scope.activeIdx = (scope.activeIdx + 1) % scope.matches.length; scope.$digest(); - popUpEl.children()[scope.activeIdx].scrollIntoView(false); + popUpEl.find('li')[scope.activeIdx].scrollIntoView(false); break; } });