Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 81e5ffb

Browse files
Andrei VarabeiAndrei Varabei
Andrei Varabei
authored and
Andrei Varabei
committed
$select.clear() sets value to null
1 parent 3642a1d commit 81e5ffb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/uiSelectController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ uis.controller('uiSelectCtrl',
451451
};
452452

453453
ctrl.clear = function($event) {
454-
ctrl.select(undefined);
454+
ctrl.select(null);
455455
$event.stopPropagation();
456456
$timeout(function() {
457457
ctrl.focusser[0].focus();

test/select.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ describe('ui-select tests', function() {
553553

554554
// Trigger clear.
555555
el.find('.select2-search-choice-close').click();
556-
expect(scope.selection.selected).toEqual(undefined);
556+
expect(scope.selection.selected).toEqual(null);
557557

558558
// If there is no selection it the X icon should be gone.
559559
expect(el.find('.select2-search-choice-close').length).toEqual(0);

0 commit comments

Comments
 (0)