Skip to content

Commit ec20801

Browse files
committed
supports Angular 1.3's $touched attribute on close
If the ngModel is defined and an angular version with $touched is used, the select will mark the ngModel as touched when the list closes, to make it consistent with the native select control.
1 parent 49df37a commit ec20801

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: src/select.js

+1
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@
422422
// Closes the dropdown
423423
ctrl.close = function(skipFocusser) {
424424
if (!ctrl.open) return;
425+
if (ctrl.ngModel && ctrl.ngModel.$setTouched) ctrl.ngModel.$setTouched();
425426
_resetSearchInput();
426427
ctrl.open = false;
427428
if (!ctrl.multiple){

0 commit comments

Comments
 (0)