From e2f4c766528d926a266992af6f336296165c5184 Mon Sep 17 00:00:00 2001 From: hannahollstrom Date: Sat, 6 Jun 2015 17:23:23 +0800 Subject: [PATCH] Fixed bug when pressing arrow keys when dropdownItems was null --- inputDropdown.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inputDropdown.js b/inputDropdown.js index ab23645..1fc3732 100644 --- a/inputDropdown.js +++ b/inputDropdown.js @@ -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)) { @@ -88,7 +88,7 @@ angular.module('inputDropdown', []).directive('inputDropdown', [function() { showDropdown(); if (!scope.inputValue) { - scope.dropdownItems = scope.defaultDropdownItems; + scope.dropdownItems = scope.defaultDropdownItems || []; return; }