File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 11<!-- Feel free to put either your handle and/or full name, according to
22 your privacy needs -->
33
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+
49* Allow the dropdown to reopen on click if it is closed without losing focus
510 by closeAfterSelect: true
611
Original file line number Diff line number Diff line change @@ -1551,6 +1551,7 @@ $.extend(Selectize.prototype, {
15511551 if ( $item . hasClass ( 'active' ) ) {
15521552 idx = self . $activeItems . indexOf ( $item [ 0 ] ) ;
15531553 self . $activeItems . splice ( idx , 1 ) ;
1554+ $item . removeClass ( 'active' ) ;
15541555 }
15551556
15561557 self . items . splice ( i , 1 ) ;
Original file line number Diff line number Diff line change 406406 } ) ;
407407 } ) ;
408408
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+
409433 } ) ;
410434
411435} ) ( ) ;
You can’t perform that action at this time.
0 commit comments