material icon indicating copy to clipboard operation
material copied to clipboard

md-autocomplete directive does not support tabindex

Open mcnocopo opened this issue 11 years ago • 6 comments

md-autocomplete directive does not pass the tabindex to the "compiled" inner input element which seem be set to 0.

The following does not work

<md-autocomplete
    tabindex="3"
    ng-disabled="vm.user.isDisabled"
    ....

Any suggestions?

mcnocopo avatar Apr 01 '15 08:04 mcnocopo

Sounds like a missing feature. Existing tabindex values should be passed to the input.

Just a warning, managing the tab order of an entire app can be challenging. That said, our components should work with native attributes as much as possible. That's a valid use case, challenging or not.

marcysutton avatar Apr 01 '15 20:04 marcysutton

As far as I can tell, tabindex works properly on autocomplete. @marcysutton can you help confirm this? As is, adding tabindex to md-autocomplete seems to work properly without transferring the attribute to the input tag. (Focusing md-autocomplete forwards focus to the input.) Is there any reason to manually transfer this attribute?

robertmesserle avatar Oct 09 '15 17:10 robertmesserle

Closing for now, will reopen if this step is necessary.

robertmesserle avatar Oct 09 '15 17:10 robertmesserle

The request was for custom tabindex values, which need to be manually moved to the input. Right now, if you add tabindex="3" to md-autocomplete it remains there, causing both the wrapper and the input to be focusable. Only the input should be focusable.

marcysutton avatar Oct 09 '15 18:10 marcysutton

That looks good to me, assuming focus is forwarded to the input since it is the element with a role.

marcysutton avatar Oct 09 '15 20:10 marcysutton

Is this fixed ? I still got this problem with 1.0.6, both md-autocomplete and the input inside have same tabindex attribute

tucq88 avatar Mar 10 '16 05:03 tucq88