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

Commit f4b7f47

Browse files
Andrei VarabeiAndrei Varabei
Andrei Varabei
authored and
Andrei Varabei
committed
$select.clear() sets value to null
1 parent af42092 commit f4b7f47

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
@@ -552,7 +552,7 @@ describe('ui-select tests', function() {
552552

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

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

0 commit comments

Comments
 (0)