Parcourir la source

escape special characters in containerId selector

TedLiang il y a 12 ans
Parent
commit
3276e22ab6
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      select2.js

+ 1 - 1
select2.js

@@ -942,7 +942,7 @@
          */
         // abstract
         opening: function() {
-            var cid = this.containerId, selector = "#"+ cid,
+            var cid = this.containerId, selector = "#"+ cid.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1'),
                 scroll = "scroll." + cid, resize = "resize." + cid;
 
             this.container.parents().each(function() {