From 2c5b284ab71d032feed5829148408bbd30af70c4 Mon Sep 17 00:00:00 2001 From: Brett Batie Date: Tue, 20 May 2014 12:38:38 -0700 Subject: [PATCH] Escape key was not being handled when no items are found in a search. --- src/select.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/select.js b/src/select.js index 44d09c2ca..4e5d05d20 100644 --- a/src/select.js +++ b/src/select.js @@ -239,7 +239,7 @@ angular.module('ui.select', []) _searchInput.on('keydown', function(e) { // Keyboard shortcuts are all about the items, // does not make sense (and will crash) if ctrl.items is empty - if (ctrl.items.length > 0) { + if (ctrl.items && ctrl.items.length >= 0) { var key = e.which; $scope.$apply(function() {