Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
fix(typeahead): use correct selector
Browse files Browse the repository at this point in the history
- 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

Closes #5168
Fixes #5167
  • Loading branch information
wesleycho committed Jan 8, 2016
1 parent 3e876b8 commit e1e6e1b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/typeahead/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -395,12 +395,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;
}
});
Expand Down

0 comments on commit e1e6e1b

Please sign in to comment.