Skip to content

Modal itself receiving focus rather than first tabbable element #54106

@getdave

Description

@getdave

The standard Modal component defines a tabindex which forces it to be focused when mounted:

As this is non-configurable it appears to be a deliberate decision but one that may be questionable from an a11y perspective as noted by @andrewhayward (see below).

Raising this Issue to discuss whether this attribute needs to be reconsidered or made configurable.

What is the rationale behind it and what arguments are there for/against removing it?


For what it's worth, from an accessibility perspective at least, it's actually strongly advised that focus is moved to a control within the dialog, rather than keeping focus on the dialog itself. In this case, where the sole purpose of the dialog is to update the text value, the text field would be a good candidate to automatically receive focus here.

Originally posted by @andrewhayward in #53735 (comment)

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions