Skip to content

Commit 773f002

Browse files
Do not set $dirty flag on init
1 parent dba325b commit 773f002

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/select2.js

+3
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ angular.module('ui.select2', []).value('uiSelect2Config', {}).directive('uiSelec
120120
elm.select2('val', controller.$viewValue);
121121
// Refresh angular to remove the superfluous option
122122
elm.trigger('change');
123+
if(newVal && !oldVal) {
124+
controller.$setPristine(true);
125+
}
123126
});
124127
});
125128
}

0 commit comments

Comments
 (0)