Skip to content

tabindex doesn't work on md-checkbox #3368

Closed

Description

@jloosli

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.

Activity

  1. devversion commented on Mar 1, 2017

    @devversion
    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

  2. changed the title [-]tabindex doesn't work on mdInput[/-] [+]tabindex doesn't work on md-checkbox[/+] on Mar 1, 2017
  3. jloosli commented on Mar 1, 2017

    @jloosli
    Author

    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

  4. crisbeto commented on Mar 2, 2017

    @crisbeto
    Member

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

  5. jloosli commented on Mar 3, 2017

    @jloosli
    Author

    @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).

  6. devversion commented on Mar 5, 2017

    @devversion
    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.

  7. added
    Accessibility
    P3
    and removed
    Accessibility
    on Apr 12, 2017
  8. jelbourn commented on Apr 12, 2017

    @jelbourn
    Contributor

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

  9. tinayuangao commented on Apr 13, 2017

    @tinayuangao
    Contributor

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

  10. angular-automatic-lock-bot commented on Sep 5, 2019

    @angular-automatic-lock-bot

    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.

  11. locked and limited conversation to collaborators on Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions