File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1928,7 +1928,7 @@ $.extend(Selectize.prototype, {
19281928			old  =  existing . filter ( function ( value )  { 
19291929				return  values . indexOf ( value )  <  0 ; 
19301930			} ) . map ( function ( value )  { 
1931- 				return  'option[value="'  +  value  +  '"]' ; 
1931+ 				return  'option[value="'  +  escape_html ( value )  +  '"]' ; 
19321932			} ) ; 
19331933
19341934			if  ( existing . length  -  old . length  +  fresh . length  ===  0  &&  ! self . $input . attr ( 'multiple' ) )  { 
Original file line number Diff line number Diff line change 530530						{ value : 0 } , 
531531						{ value : 1 } , 
532532						{ value : 2 } , 
533- 						{ value : 3 } , 
533+ 						{ value : JSON . stringify ( { "type" : "place" } ) } , 
534534					] , 
535535					items : [ '1' , '2' , '3' ] 
536536				} ) ; 
549549				// 		{value: 0}, 
550550				// 		{value: 1}, 
551551				// 		{value: 2}, 
552- 				// 		{value: 3 }, 
552+ 				// 		{value: JSON.stringify({"type":"place"} ) }, 
553553				// 	], 
554554				// 	items: ['1','2','3'] 
555555				// }); 
561561					window . setTimeout ( function ( )  { 
562562						expect ( test . selectize . $dropdown_content . find ( '[data-value=1]' ) . length ) . to . be . equal ( 1 ) ; 
563563						expect ( test . selectize . $dropdown_content . find ( '[data-value=2]' ) . length ) . to . be . equal ( 1 ) ; 
564- 						expect ( test . selectize . $dropdown_content . find ( '[data-value=3 ]' ) . length ) . to . be . equal ( 1 ) ; 
564+ 						expect ( test . selectize . $dropdown_content . find ( '[data-value*="type" ]' ) . length ) . to . be . equal ( 1 ) ; 
565565						done ( ) ; 
566566					} ,  0 ) ; 
567567				} ,  0 ) ; 
574574				test . selectize . clear ( ) ; 
575575				expect ( test . selectize . $control . find ( '[data-value=1]' ) . length ) . to . be . equal ( 0 ) ; 
576576				expect ( test . selectize . $control . find ( '[data-value=2]' ) . length ) . to . be . equal ( 0 ) ; 
577- 				expect ( test . selectize . $control . find ( '[data-value=3 ]' ) . length ) . to . be . equal ( 0 ) ; 
577+ 				expect ( test . selectize . $control . find ( '[data-value*="type" ]' ) . length ) . to . be . equal ( 0 ) ; 
578578			} ) ; 
579579			it ( 'should not fire "change" if silent is truthy' ,  function ( done )  { 
580580				var  watcher  =  function ( e )  {  throw  new  Error ( 'Change fired' ) ;  } ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments