@@ -84,7 +84,7 @@ export type MdSelectFloatPlaceholderType = 'always' | 'never' | 'auto';
8484 encapsulation : ViewEncapsulation . None ,
8585 host : {
8686 'role' : 'listbox' ,
87- '[attr.tabindex]' : '_getTabIndex() ' ,
87+ '[attr.tabindex]' : 'tabIndex ' ,
8888 '[attr.aria-label]' : 'placeholder' ,
8989 '[attr.aria-required]' : 'required.toString()' ,
9090 '[attr.aria-disabled]' : 'disabled.toString()' ,
@@ -133,6 +133,9 @@ export class MdSelect implements AfterContentInit, ControlValueAccessor, OnDestr
133133 /** The animation state of the placeholder. */
134134 private _placeholderState = '' ;
135135
136+ /** Tab index for the element. */
137+ private _tabIndex : number = 0 ;
138+
136139 /**
137140 * The width of the trigger. Must be saved to set the min width of the overlay panel
138141 * and the width of the selected value.
@@ -237,6 +240,15 @@ export class MdSelect implements AfterContentInit, ControlValueAccessor, OnDestr
237240 }
238241 private _floatPlaceholder : MdSelectFloatPlaceholderType = 'auto' ;
239242
243+ /** Tab index for the select element. */
244+ @Input ( )
245+ get tabIndex ( ) : number { return this . _disabled ? - 1 : this . _tabIndex ; }
246+ set tabIndex ( value : number ) {
247+ if ( typeof value !== 'undefined' ) {
248+ this . _tabIndex = value ;
249+ }
250+ }
251+
240252 /** Event emitted when the select has been opened. */
241253 @Output ( ) onOpen : EventEmitter < void > = new EventEmitter < void > ( ) ;
242254
@@ -407,12 +419,6 @@ export class MdSelect implements AfterContentInit, ControlValueAccessor, OnDestr
407419 }
408420 }
409421
410- /** Returns the correct tabindex for the select depending on disabled state. */
411- _getTabIndex ( ) {
412- return this . disabled ? '-1' : '0' ;
413- }
414-
415-
416422 /**
417423 * Sets the scroll position of the scroll container. This must be called after
418424 * the overlay pane is attached or the scroll container element will not yet be
0 commit comments