Skip to content

Commit f1db213

Browse files
committed
Delete a strange empty tag when no one is selected
1 parent 4469fd7 commit f1db213

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/select2.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ angular.module('ui.select2', []).value('uiSelect2Config', {}).directive('uiSelec
200200
elm.select2(opts);
201201

202202
// Set initial value - I'm not sure about this but it seems to need to be there
203-
elm.select2('data', controller.$modelValue);
203+
if (controller.$viewValue) {
204+
elm.select2('data', controller.$modelValue);
205+
}
204206
// important!
205207
controller.$render();
206208

0 commit comments

Comments
 (0)