Skip to content

Focus trap does not respect tabindex #5435

@Eddman

Description

@Eddman

Bug, feature request, or proposal:

Bug.

What is the expected behavior?

Focus trap will focus elements with respect to tabindex attribute.

What is the current behavior?

When a dialog body (or any other focus trap) contains a HTML like this:

<input type="text" tabindex=2 ...>
<button tabindex=1 ...>

the input is focused, but the button should be obviously.

In addition using higher tabindex then 0 causes the focus trap to stop working at all. The anchors have tabindex 0 and are focused after all other elements on the page with tabindex not set. User is therfore able to focus elements under dialog overlay.

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

@angular 4.2.4
@angular/material 2.0.0-beta.7

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions