Skip to content

Export modal: focus positioned on "Cancel" button on opening #2343

@cyberbaloo

Description

@cyberbaloo

Observed behavior

When opening the document export modal, focus is positioned on the "Cancel" button instead of the first focusable element of the modal, namely the export format selection dropdown menu.

Expected behavior

Following the ARIA APG [Dialog (Modal) Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/), focus should be moved to the first focusable element of the modal when it opens, i.e. the format selection dropdown menu.

Steps to reproduce

  1. Open a Docs document
  2. Trigger the document export
  3. Observe that when the modal opens, focus is positioned on the "Cancel" button and not on the format selection dropdown menu

Additional context / Screenshots

The APG pattern specifies that focus should be placed on the first focusable element of the dialog, unless the design requires targeting a specific element (e.g., a dangerous confirmation button). This case does not apply here: the "Cancel" button is not the most relevant element to highlight on opening.

RGAA criteria

Critère 7.1 : Chaque script est-il, si nécessaire, compatible avec les technologies d'assistance ?

Impact

A user navigating with keyboard or screen reader opens the export modal: focus lands on "Cancel", forcing them to navigate backwards to reach the format selection dropdown menu, the first useful element of the modal.

Prioritization

P1

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status
No status
Status
In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions