[Autocomplete] Check if indexed filteredOptions is defined

This commit is contained in:
Dhrubomoy Das Gupta 2017-06-04 17:49:31 -04:00
parent 7cdb8db775
commit 98cc19c637

View File

@ -68,7 +68,9 @@ define(
} }
function fillInputWithIndexedOption() { function fillInputWithIndexedOption() {
$scope.ngModel[$scope.field] = $scope.filteredOptions[$scope.optionIndex].name; if($scope.filteredOptions[$scope.optionIndex]) {
$scope.ngModel[$scope.field] = $scope.filteredOptions[$scope.optionIndex].name;
}
} }
$scope.keyDown = function($event) { $scope.keyDown = function($event) {