@@ -773,6 +773,7 @@ describe('ui-select tests', function() {
773
773
if ( attrs !== undefined ) {
774
774
if ( attrs . disabled !== undefined ) { attrsHtml += ' ng-disabled="' + attrs . disabled + '"' ; }
775
775
if ( attrs . required !== undefined ) { attrsHtml += ' ng-required="' + attrs . required + '"' ; }
776
+ if ( attrs . tabindex !== undefined ) { attrsHtml += ' tabindex="' + attrs . tabindex + '"' ; }
776
777
}
777
778
778
779
return compileTemplate (
@@ -818,6 +819,31 @@ describe('ui-select tests', function() {
818
819
// $timeout.flush();
819
820
} ) ;
820
821
822
+ it ( 'should pass tabindex to searchInput' , function ( ) {
823
+ var el = createUiSelectMultiple ( { tabindex : 5 } ) ;
824
+ var searchInput = el . find ( '.ui-select-search' ) ;
825
+
826
+ expect ( searchInput . attr ( 'tabindex' ) ) . toEqual ( '5' ) ;
827
+ expect ( $ ( el ) . attr ( 'tabindex' ) ) . toEqual ( undefined ) ;
828
+ } ) ;
829
+
830
+ it ( 'should pass tabindex to searchInput when tabindex is an expression' , function ( ) {
831
+ scope . tabValue = 22 ;
832
+ var el = createUiSelectMultiple ( { tabindex : '{{tabValue + 10}}' } ) ;
833
+ var searchInput = el . find ( '.ui-select-search' ) ;
834
+
835
+ expect ( searchInput . attr ( 'tabindex' ) ) . toEqual ( '32' ) ;
836
+ expect ( $ ( el ) . attr ( 'tabindex' ) ) . toEqual ( undefined ) ;
837
+ } ) ;
838
+
839
+ it ( 'should not give searchInput a tabindex when ui-select does not have one' , function ( ) {
840
+ var el = createUiSelectMultiple ( ) ;
841
+ var searchInput = el . find ( '.ui-select-search' ) ;
842
+
843
+ expect ( searchInput . attr ( 'tabindex' ) ) . toEqual ( undefined ) ;
844
+ expect ( $ ( el ) . attr ( 'tabindex' ) ) . toEqual ( undefined ) ;
845
+ } ) ;
846
+
821
847
it ( 'should update size of search input after removing an item' , function ( ) {
822
848
scope . selection . selectedMultiple = [ scope . people [ 4 ] , scope . people [ 5 ] ] ; //Wladimir & Samantha
823
849
var el = createUiSelectMultiple ( ) ;
0 commit comments