File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1928,7 +1928,7 @@ $.extend(Selectize.prototype, {
1928
1928
old = existing . filter ( function ( value ) {
1929
1929
return values . indexOf ( value ) < 0 ;
1930
1930
} ) . map ( function ( value ) {
1931
- return 'option[value="' + value + '"]' ;
1931
+ return 'option[value="' + escape_html ( value ) + '"]' ;
1932
1932
} ) ;
1933
1933
1934
1934
if ( existing . length - old . length + fresh . length === 0 && ! self . $input . attr ( 'multiple' ) ) {
Original file line number Diff line number Diff line change 530
530
{ value : 0 } ,
531
531
{ value : 1 } ,
532
532
{ value : 2 } ,
533
- { value : 3 } ,
533
+ { value : JSON . stringify ( { "type" : "place" } ) } ,
534
534
] ,
535
535
items : [ '1' , '2' , '3' ]
536
536
} ) ;
549
549
// {value: 0},
550
550
// {value: 1},
551
551
// {value: 2},
552
- // {value: 3 },
552
+ // {value: JSON.stringify({"type":"place"} ) },
553
553
// ],
554
554
// items: ['1','2','3']
555
555
// });
561
561
window . setTimeout ( function ( ) {
562
562
expect ( test . selectize . $dropdown_content . find ( '[data-value=1]' ) . length ) . to . be . equal ( 1 ) ;
563
563
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 ) ;
565
565
done ( ) ;
566
566
} , 0 ) ;
567
567
} , 0 ) ;
574
574
test . selectize . clear ( ) ;
575
575
expect ( test . selectize . $control . find ( '[data-value=1]' ) . length ) . to . be . equal ( 0 ) ;
576
576
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 ) ;
578
578
} ) ;
579
579
it ( 'should not fire "change" if silent is truthy' , function ( done ) {
580
580
var watcher = function ( e ) { throw new Error ( 'Change fired' ) ; } ;
You can’t perform that action at this time.
0 commit comments