File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ uis.controller('uiSelectCtrl',
333
333
}
334
334
335
335
if ( ! isDisabled && disabledItemIndex > - 1 ) {
336
- disabledItems . splice ( disabledItemIndex , 0 ) ;
336
+ disabledItems . splice ( disabledItemIndex , 1 ) ;
337
337
}
338
338
}
339
339
Original file line number Diff line number Diff line change @@ -1809,6 +1809,7 @@ describe('ui-select tests', function() {
1809
1809
if ( attrs . inputId !== undefined ) { attrsHtml += ' input-id="' + attrs . inputId + '"' ; }
1810
1810
if ( attrs . groupBy !== undefined ) { choicesAttrsHtml += ' group-by="' + attrs . groupBy + '"' ; }
1811
1811
if ( attrs . lockChoice !== undefined ) { matchesAttrsHtml += ' ui-lock-choice="' + attrs . lockChoice + '"' ; }
1812
+ if ( attrs . removeSelected !== undefined ) { attrsHtml += ' remove-selected="' + attrs . removeSelected + '"' ; }
1812
1813
}
1813
1814
1814
1815
return compileTemplate (
@@ -2743,6 +2744,16 @@ describe('ui-select tests', function() {
2743
2744
clickItem ( el , 'Samantha' ) ;
2744
2745
expect ( el . hasClass ( 'ng-not-empty' ) ) . toBeTruthy ( ) ;
2745
2746
} ) ;
2747
+
2748
+ it ( 'should be able to re-select the item with removeselected set to false' , function ( ) {
2749
+ scope . selection . selectedMultiple = [ scope . people [ 4 ] , scope . people [ 5 ] ] ; //Wladimir & Samantha
2750
+ var el = createUiSelectMultiple ( { removeSelected : true } ) ;
2751
+ expect ( el . scope ( ) . $select . selected . length ) . toBe ( 2 ) ;
2752
+ el . find ( '.ui-select-match-item' ) . first ( ) . find ( '.ui-select-match-close' ) . click ( ) ;
2753
+ expect ( el . scope ( ) . $select . selected . length ) . toBe ( 1 ) ;
2754
+ clickItem ( el , 'Wladimir' ) ;
2755
+ expect ( el . scope ( ) . $select . selected . length ) . toBe ( 2 ) ;
2756
+ } ) ;
2746
2757
} ) ;
2747
2758
2748
2759
it ( 'should add an id to the search input field' , function ( ) {
You can’t perform that action at this time.
0 commit comments