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

Commit e1e6e1b

Browse files
committed
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 Closes #5168 Fixes #5167
1 parent 3e876b8 commit e1e6e1b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/typeahead/typeahead.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap
4646
var isEditable = originalScope.$eval(attrs.typeaheadEditable) !== false;
4747
originalScope.$watch(attrs.typeaheadEditable, function (newVal) {
4848
isEditable = newVal !== false;
49-
});
49+
});
5050

5151
//binding to a variable that indicates if matches are being retrieved asynchronously
5252
var isLoadingSetter = $parse(attrs.typeaheadLoading).assign || angular.noop;
@@ -395,12 +395,12 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap
395395
case 38:
396396
scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1;
397397
scope.$digest();
398-
popUpEl.children()[scope.activeIdx].scrollIntoView(false);
398+
popUpEl.find('li')[scope.activeIdx].scrollIntoView(false);
399399
break;
400400
case 40:
401401
scope.activeIdx = (scope.activeIdx + 1) % scope.matches.length;
402402
scope.$digest();
403-
popUpEl.children()[scope.activeIdx].scrollIntoView(false);
403+
popUpEl.find('li')[scope.activeIdx].scrollIntoView(false);
404404
break;
405405
}
406406
});

0 commit comments

Comments
 (0)