From 632595f53072624c7d2a83e095a8346781a5ef07 Mon Sep 17 00:00:00 2001 From: jorupp Date: Tue, 15 Apr 2014 16:36:24 -0500 Subject: [PATCH] Fix issue syncing CSS classes in IE9/10 --- select2.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/select2.js b/select2.js index b61b737f..869bd1ad 100644 --- a/select2.js +++ b/select2.js @@ -1079,9 +1079,13 @@ the specific language governing permissions and limitations under the Apache Lic }); - // IE8-10 - el.on("propertychange.select2", sync); - + // IE8-10 (IE9/10 won't fire propertyChange via attachEventListener) + if (el.length && el[0].attachEvent) { + el.each(function() { + this.attachEvent("onpropertychange", sync); + }); + } + // hold onto a reference of the callback to work around a chromium bug if (this.mutationCallback === undefined) { this.mutationCallback = function (mutations) {