@@ -684,8 +684,10 @@ the specific language governing permissions and limitations under the Apache Lic
684684 . addClass ( "select2-hidden-accessible" )
685685 . appendTo ( document . body ) ;
686686
687- this . containerId = "s2id_" + ( opts . element . attr ( "id" ) || "autogen" + nextUid ( ) ) . replace ( / ( [ ; & , \- \. \+ \* \~ ' : " \! \^ # $ % @ \[ \] \( \) = > \| ] ) / g, '\\$1' ) ;
688- this . containerSelector = "#" + this . containerId ;
687+ this . containerId = "s2id_" + ( opts . element . attr ( "id" ) || "autogen" + nextUid ( ) ) ;
688+ this . containerEventName = this . containerId
689+ . replace ( / ( [ . ] ) / g, '_' )
690+ . replace ( / ( [ ; & , \- \. \+ \* \~ ' : " \! \^ # $ % @ \[ \] \( \) = > \| ] ) / g, '\\$1' ) ;
689691 this . container . attr ( "id" , this . containerId ) ;
690692
691693 this . container . attr ( "title" , opts . element . attr ( "title" ) ) ;
@@ -1335,7 +1337,7 @@ the specific language governing permissions and limitations under the Apache Lic
13351337 */
13361338 // abstract
13371339 opening : function ( ) {
1338- var cid = this . containerId ,
1340+ var cid = this . containerEventName ,
13391341 scroll = "scroll." + cid ,
13401342 resize = "resize." + cid ,
13411343 orient = "orientationchange." + cid ,
@@ -1407,7 +1409,7 @@ the specific language governing permissions and limitations under the Apache Lic
14071409 close : function ( ) {
14081410 if ( ! this . opened ( ) ) return ;
14091411
1410- var cid = this . containerId ,
1412+ var cid = this . containerEventName ,
14111413 scroll = "scroll." + cid ,
14121414 resize = "resize." + cid ,
14131415 orient = "orientationchange." + cid ;
0 commit comments