Components: md-tab explicit tabindex

Created on 17 Jun 2018  路  4Comments  路  Source: angular/components

Bug, feature request, or proposal:

Feature request.

What is the expected behavior?

I want to be able to set mat-tabs tabindex values declaratively.

What is the current behavior?

tabindex value of the first md-tab item is 0 by default and others are -1 and I can't change it.

What is the use-case or motivation for changing an existing behavior?

  1. This came from keyboard accessibility requirements that have explicit tabindex implementation. For example, I have one tabindexed block before mat-tab-group (say, 300 - 308) and another one after (500-504). And I need the first (active) md-tab to have tabindex 400.

  2. Another use case is to have a possibility to switch between md-tabs by TAB key pressing.

Most helpful comment

@josephperrott This does not solve native tabindex attribute issue. No matter of selectedIndex on mat-tab-group the real tabindex on real DOM elements would be 0 (if active) or -1 (inactive). And explicit tabindex keyboard accessibility implementation would be broken.

Also, it does not help with md-tabs TAB key switching (per -1 tabindex attribute value if inactive). Maybe this one should be extracted into a separate issue.

If you have no plans to support native tabindexes manipulation, the issue could stay closed with appropriate comment. Currently it seems there is some misunderstanding...

All 4 comments

Closing as you are able to set the current tab index using the selectedIndex attribute on mat-tab-group as seen here

@josephperrott This does not solve native tabindex attribute issue. No matter of selectedIndex on mat-tab-group the real tabindex on real DOM elements would be 0 (if active) or -1 (inactive). And explicit tabindex keyboard accessibility implementation would be broken.

Also, it does not help with md-tabs TAB key switching (per -1 tabindex attribute value if inactive). Maybe this one should be extracted into a separate issue.

If you have no plans to support native tabindexes manipulation, the issue could stay closed with appropriate comment. Currently it seems there is some misunderstanding...

Not good to affect native tabindex behavior. This affects accessibility.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

crutchcorn picture crutchcorn  路  3Comments

alanpurple picture alanpurple  路  3Comments

kara picture kara  路  3Comments

michaelb-01 picture michaelb-01  路  3Comments

MurhafSousli picture MurhafSousli  路  3Comments