Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tabindex doesn't work on md-checkbox #3368

Closed
jloosli opened this issue Mar 1, 2017 · 8 comments
Closed

tabindex doesn't work on md-checkbox #3368

jloosli opened this issue Mar 1, 2017 · 8 comments
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@jloosli
Copy link

jloosli commented Mar 1, 2017

Bug, feature request, or proposal:

I am not able to disable tabbing to a md-checkbox.

What is the expected behavior?

<md-checkbox tabIndex="-1"></md-checkbox> should not be skipped over when tabbing through a form.

What is the current behavior?

The checkbox receives focus when tabbing through the form. In addition, there isn't any visual indication that the checkbox has focus, so it's difficult to tell where I am in the form unless I press the spacebar to toggle that particular entry.

What are the steps to reproduce?

http://plnkr.co/edit/0P5w3xAmYWhx4ZrEoWUU?p=preview

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

I have checkbox that I want on the form, but not to be tabbed to.

Which versions of Angular, Material, OS, browsers are affected?

Tested on Angular 2.4.8, Angular/Material 2.0.0-beta.2, Chrome

Is there anything else we should know?

That more or less covers it.

@devversion
Copy link
Member

You mentioned in the issue that you are using tabIndex in camelcase. But in your Plunkr it's actually just tabindex.

For those components, just using tabIndex in camelcase should do the trick.

http://plnkr.co/edit/4ScdvxMz8q2Q5RC6bILh?p=preview

@jloosli jloosli changed the title tabindex doesn't work on mdInput tabindex doesn't work on md-checkbox Mar 1, 2017
@jloosli
Copy link
Author

jloosli commented Mar 1, 2017

Whoops..I had the wrong title down...it's actually md-checkbox that tabindex doesn't work. I also corrected the example to have a lowercase tabindex

@crisbeto
Copy link
Member

crisbeto commented Mar 2, 2017

WRT to the focus indication, it is being tracked via #3102.

@jloosli
Copy link
Author

jloosli commented Mar 3, 2017

@devversion So I just came back to this and see that it does indeed work with the camelcase tabIndex. Is that the plan to keep it like that? I'm glad that it works, but given that the spec for tabindex is all lowercase, I wonder if that will cause additional confusion (beyond just myself).

@devversion
Copy link
Member

Not sure. I see that it can cause confusion here, but I think the tabIndex is in camel-cause because when using an input binding, you are actually setting the native tabIndex property.

That's why for native inputs you can also do

<input [tabIndex]="2">

Not sure if we should support both.

@jelbourn jelbourn added Accessibility This issue is related to accessibility (a11y) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed Accessibility This issue is related to accessibility (a11y) labels Apr 12, 2017
@jelbourn
Copy link
Member

@tinayuangao are you able to confirm if this is an issue?

@tinayuangao
Copy link
Contributor

It's fixed by #3403. Now checkbox has focus indicator and [tabIndex]="-1" works.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

5 participants