Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit ff3ce10

Browse files
author
Dean Sofer
committed
fix(backcompat): Adding a check for controller.$setPristine before calling
1 parent 26e4a5d commit ff3ce10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/select2.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ angular.module('ui.select2', []).value('uiSelect2Config', {}).directive('uiSelec
121121
elm.select2('val', controller.$viewValue);
122122
// Refresh angular to remove the superfluous option
123123
elm.trigger('change');
124-
if(newVal && !oldVal) {
124+
if(newVal && !oldVal && controller.$setPristine) {
125125
controller.$setPristine(true);
126126
}
127127
});

0 commit comments

Comments
 (0)