Skip to content

feat(tab-group): Add an input to restore focus to active (selected) tab on re-entry #32858

@gilbertoayala12

Description

@gilbertoayala12

Feature Description

When using MatTabGroup with manual tab activation, focus returns to the last arrow-key-focused tab when a user re-enters the tab list via the Tab key. I understand this is intentional roving tabindex behavior #14194.

Possible Solution

Since I understand the current behavior is intended, we could implement an input focusActivatedTabOnReturn set to false by default but if set to true we would restore focus to the currently selected tab when the user returns focus to the tab-group.

Use Case

However this creates an accessibility scenario for keyboard-only users when they select a tab, user moves across tabs with arrow keys, then moves away from the tab-group and finally they circle back to the tab-group they will land on the last focused tab.
This behavior departs from the WAI-ARIA APG Tabs Pattern which states:

When focus moves into the tab list, places focus on the active tab element.
APG Tabs Pattern

Personally I encountered this issue while working with an application with strict accessibility compliance requirements and had to patch it which in my opinion is a bit fragile and not sustainable (on our side).

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureLabel used to distinguish feature request from other issuesneeds triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions