@@ -40,7 +40,8 @@ describe('MdSelect', () => {
4040 SelectWithErrorSibling ,
4141 ThrowsErrorOnInit ,
4242 BasicSelectOnPush ,
43- BasicSelectOnPushPreselected
43+ BasicSelectOnPushPreselected ,
44+ SelectWithPlainTabindex
4445 ] ,
4546 providers : [
4647 { provide : OverlayContainer , useFactory : ( ) => {
@@ -1046,6 +1047,17 @@ describe('MdSelect', () => {
10461047 expect ( select . getAttribute ( 'tabindex' ) ) . toBe ( '3' ) ;
10471048 } ) ;
10481049
1050+ it ( 'should be able to set the tabindex via the native attribute' , ( ) => {
1051+ fixture . destroy ( ) ;
1052+
1053+ const plainTabindexFixture = TestBed . createComponent ( SelectWithPlainTabindex ) ;
1054+
1055+ plainTabindexFixture . detectChanges ( ) ;
1056+ select = plainTabindexFixture . debugElement . query ( By . css ( 'md-select' ) ) . nativeElement ;
1057+
1058+ expect ( select . getAttribute ( 'tabindex' ) ) . toBe ( '5' ) ;
1059+ } ) ;
1060+
10491061 it ( 'should set aria-required for required selects' , ( ) => {
10501062 expect ( select . getAttribute ( 'aria-required' ) )
10511063 . toEqual ( 'false' , `Expected aria-required attr to be false for normal selects.` ) ;
@@ -1627,6 +1639,14 @@ class FloatPlaceholderSelect {
16271639 @ViewChild ( MdSelect ) select : MdSelect ;
16281640}
16291641
1642+ @Component ( {
1643+ selector : 'select-with-plain-tabindex' ,
1644+ template : `
1645+ <md-select tabindex="5"></md-select>
1646+ `
1647+ } )
1648+ class SelectWithPlainTabindex { }
1649+
16301650
16311651class FakeViewportRuler {
16321652 getViewportRect ( ) {
0 commit comments