File tree 3 files changed +30
-0
lines changed 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1
1
<!-- Feel free to put either your handle and/or full name, according to
2
2
your privacy needs -->
3
3
4
+ * Fixed incorrect highlighting of options that were activated, removed
5
+ and then re-added in "multiple" mode (#1212 and #1216 )
6
+
7
+ * @sustmi *
8
+
4
9
* Allow the dropdown to reopen on click if it is closed without losing focus
5
10
by closeAfterSelect: true
6
11
Original file line number Diff line number Diff line change @@ -1551,6 +1551,7 @@ $.extend(Selectize.prototype, {
1551
1551
if ( $item . hasClass ( 'active' ) ) {
1552
1552
idx = self . $activeItems . indexOf ( $item [ 0 ] ) ;
1553
1553
self . $activeItems . splice ( idx , 1 ) ;
1554
+ $item . removeClass ( 'active' ) ;
1554
1555
}
1555
1556
1556
1557
self . items . splice ( i , 1 ) ;
Original file line number Diff line number Diff line change 406
406
} ) ;
407
407
} ) ;
408
408
409
+ describe ( 'deleting active item' , function ( ) {
410
+ it ( 'should deactivate the item' , function ( done ) {
411
+ var test = setup_test ( '<select multiple="multiple">' +
412
+ '<option value="a">A</option>' +
413
+ '<option value="b">B</option>' +
414
+ '</select>' , { } ) ;
415
+
416
+ click ( test . selectize . $control , function ( ) {
417
+ click ( $ ( '[data-value="a"]' , test . selectize . $dropdown ) , function ( ) {
418
+ click ( $ ( '[data-value="a"]' , test . selectize . $control ) , function ( ) {
419
+ syn
420
+ . type ( '[backspace]' , test . selectize . $control_input )
421
+ . delay ( 5 , function ( ) {
422
+ click ( $ ( '[data-value="a"]' , test . selectize . $dropdown ) , function ( ) {
423
+ expect ( $ ( '[data-value="a"]' , test . selectize . $control ) . hasClass ( 'active' ) ) . to . be . equal ( false ) ;
424
+ done ( ) ;
425
+ } ) ;
426
+ } ) ;
427
+ } ) ;
428
+ } ) ;
429
+ } ) ;
430
+ } ) ;
431
+ } ) ;
432
+
409
433
} ) ;
410
434
411
435
} ) ( ) ;
You can’t perform that action at this time.
0 commit comments