Skip to content

Commit

Permalink
Fixed bug when pressing arrow keys when dropdownItems was null
Browse files Browse the repository at this point in the history
  • Loading branch information
hannaholl committed Jun 6, 2015
1 parent a6ae7a7 commit e2f4c76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inputDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ angular.module('inputDropdown', []).directive('inputDropdown', [function() {
scope.activeItemIndex = 0;
scope.inputValue = '';
scope.dropdownVisible = false;
scope.dropdownItems = scope.defaultDropdownItems;
scope.dropdownItems = scope.defaultDropdownItems || [];

scope.$watch('dropdownItems', function(newValue, oldValue) {
if (!angular.equals(newValue, oldValue)) {
Expand Down Expand Up @@ -88,7 +88,7 @@ angular.module('inputDropdown', []).directive('inputDropdown', [function() {
showDropdown();

if (!scope.inputValue) {
scope.dropdownItems = scope.defaultDropdownItems;
scope.dropdownItems = scope.defaultDropdownItems || [];
return;
}

Expand Down

0 comments on commit e2f4c76

Please sign in to comment.