@@ -42,7 +42,8 @@ describe('MdSelect', () => {
4242 SelectWithErrorSibling ,
4343 ThrowsErrorOnInit ,
4444 BasicSelectOnPush ,
45- BasicSelectOnPushPreselected
45+ BasicSelectOnPushPreselected ,
46+ SelectWithPlainTabindex
4647 ] ,
4748 providers : [
4849 { provide : OverlayContainer , useFactory : ( ) => {
@@ -1092,6 +1093,17 @@ describe('MdSelect', () => {
10921093 expect ( select . getAttribute ( 'tabindex' ) ) . toBe ( '3' ) ;
10931094 } ) ;
10941095
1096+ it ( 'should be able to set the tabindex via the native attribute' , ( ) => {
1097+ fixture . destroy ( ) ;
1098+
1099+ const plainTabindexFixture = TestBed . createComponent ( SelectWithPlainTabindex ) ;
1100+
1101+ plainTabindexFixture . detectChanges ( ) ;
1102+ select = plainTabindexFixture . debugElement . query ( By . css ( 'md-select' ) ) . nativeElement ;
1103+
1104+ expect ( select . getAttribute ( 'tabindex' ) ) . toBe ( '5' ) ;
1105+ } ) ;
1106+
10951107 it ( 'should set aria-required for required selects' , ( ) => {
10961108 expect ( select . getAttribute ( 'aria-required' ) )
10971109 . toEqual ( 'false' , `Expected aria-required attr to be false for normal selects.` ) ;
@@ -1873,6 +1885,14 @@ class MultiSelect {
18731885 @ViewChildren ( MdOption ) options : QueryList < MdOption > ;
18741886}
18751887
1888+ @Component ( {
1889+ selector : 'select-with-plain-tabindex' ,
1890+ template : `
1891+ <md-select tabindex="5"></md-select>
1892+ `
1893+ } )
1894+ class SelectWithPlainTabindex { }
1895+
18761896
18771897class FakeViewportRuler {
18781898 getViewportRect ( ) {
0 commit comments