Skip to content

Focus trap focuses the wrong radio button if native radio button group is the first element in modal #22878

Open
@krryan

Description

@krryan

If the first focus-able element in a modal is a group of (native element, not Material) radio buttons, and one tabs off the end of the modal (triggering the focus trap and returning the focus to the top of the modal), the first radio button is always focused, even if the selected radio button is one of the later ones.

The expected behavior—found when tabbing to a group of radio buttons in other cases—is for focus to go to the selected radio button.

For now, our workaround is just to ensure there is always some other focus-able element at the top of the modal. A close button works well for this.

I could not find any issues relating to this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: cdk/a11y

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions