diff --git a/src/uiSelectController.js b/src/uiSelectController.js index e304279d4..66b7bf047 100644 --- a/src/uiSelectController.js +++ b/src/uiSelectController.js @@ -451,7 +451,7 @@ uis.controller('uiSelectCtrl', }; ctrl.clear = function($event) { - ctrl.select(undefined); + ctrl.select(null); $event.stopPropagation(); $timeout(function() { ctrl.focusser[0].focus(); diff --git a/test/select.spec.js b/test/select.spec.js index 5bdce1059..8c4101dc9 100644 --- a/test/select.spec.js +++ b/test/select.spec.js @@ -552,7 +552,7 @@ describe('ui-select tests', function() { // Trigger clear. el.find('.select2-search-choice-close').click(); - expect(scope.selection.selected).toEqual(undefined); + expect(scope.selection.selected).toEqual(null); // If there is no selection it the X icon should be gone. expect(el.find('.select2-search-choice-close').length).toEqual(0);