Skip to content

Commit a9755e5

Browse files
1 parent be1d468 commit a9755e5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/select2-tagbox.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,25 @@ function init(Survey, $) {
3131
default: null
3232
});
3333
},
34+
fixStyles: function(el) {
35+
el.parentElement.querySelector(".select2-search__field").style.border =
36+
"none";
37+
},
3438
afterRender: function(question, el) {
39+
var self = this;
3540
var settings = question.select2Config;
3641
var $el = $(el).is("select") ? $(el) : $(el).find("select");
37-
var select2Input = el.parentElement.querySelector(
38-
".select2-search__field"
39-
);
40-
select2Input && (select2Input.style.border = "none");
4142
$el.select2({
4243
tags: "true",
4344
disabled: question.isReadOnly,
4445
theme: "classic"
4546
});
47+
48+
self.fixStyles(el);
49+
4650
var updateValueHandler = function() {
4751
$el.val(question.value).trigger("change");
52+
self.fixStyles(el);
4853
};
4954
var updateChoices = function() {
5055
$el.select2().empty();

0 commit comments

Comments
 (0)