Skip to content

[a11y][Page] Secondary actions should have an ability to receive focus #8105

Open
@tatianau

Description

@tatianau

Issue summary

There is a focus management issue prevalent across the Admin. Many of the Page secondary actions in the Admin - e.g. Import, Export, Duplicate, etc. - open a modal, and currently there is no easy way to return focus to the modal activator when the activator is the secondary action of the Page component that doesn't support it.

Expected behavior

Ability to connect Page secondary actions to the modal or any other overlay to be able to return focus to the activator.
For example, by adding the ability to provide an activatorRef to <Page />'s secondaryActions to then pass it to the <Modal /> as an activator.

Actual behavior

No ability to connect <Page />'s secondary actions to the overlay they open.

Steps to reproduce the problem

  1. Open any section that has secondary actions that open a modal.
    1.1. Example actions: Export, Import, Duplicate.
    1.2. Example pages: Discount index, Product index, Product details, Variant details.
  2. Use keyboard tab to navigate through the page
  3. Activate the action to open a modal
  4. Close modal or cancel out of it
  5. See the focus returns to the top of the page instead of the modal activator
Product export modal focus
Export.modal.activator.focus.mp4

Relevant discussions and previous attempts to fix it

#8058, #5258, #5495, Shopify/web-configs#349

Metadata

Metadata

Labels

AccessibilityNeeds design, development, or content work relating to accessibility.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions