File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -961,12 +961,19 @@ the specific language governing permissions and limitations under the Apache Lic
961961
962962 // mozilla and IE
963963 el . bind ( "propertychange.select2 DOMAttrModified.select2" , sync ) ;
964+
965+
966+ // hold onto a reference of the callback to work around a chromium bug
967+ if ( this . mutationCallback === undefined ) {
968+ this . mutationCallback = function ( mutations ) {
969+ mutations . forEach ( sync ) ;
970+ }
971+ }
972+
964973 // safari and chrome
965974 if ( typeof WebKitMutationObserver !== "undefined" ) {
966975 if ( this . propertyObserver ) { delete this . propertyObserver ; this . propertyObserver = null ; }
967- this . propertyObserver = new WebKitMutationObserver ( function ( mutations ) {
968- mutations . forEach ( sync ) ;
969- } ) ;
976+ this . propertyObserver = new WebKitMutationObserver ( this . mutationCallback ) ;
970977 this . propertyObserver . observe ( el . get ( 0 ) , { attributes :true , subtree :false } ) ;
971978 }
972979 } ,
You can’t perform that action at this time.
0 commit comments