Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Navigation] Mobile navigation incorrect component pattern #3679

Open
svinkle opened this issue Dec 3, 2024 · 0 comments
Open

[Navigation] Mobile navigation incorrect component pattern #3679

svinkle opened this issue Dec 3, 2024 · 0 comments
Labels
Category: Accessibility Bugs found while using assistive technology Category: Enhancement New feature or request Critical Path: 1 Affects all merchants/buyers Effort: High Severity: 3 Normal/Low Severity

Comments

@svinkle
Copy link
Member

svinkle commented Dec 3, 2024

Issue summary

The current implementation of the Dawn theme mobile navigation component generates a disclosure pattern (show/hide). Due to the visual affordance and design of the mobile navigation component being full height/width of the viewport, the current implementation could cause a frustration or confusing user experience.

Note: this issue was raised by a Shopify merchant during an accessibility audit.

Screenshots

Dawn mobile navigation control is highlighted.
Dawn mobile navigation container is expanded.

Current code

<details id="Details-menu-drawer-container">
  <summary
    aria-label="Menu"
    role="button"
    aria-expanded="false"
    aria-controls="menu-drawer"
  >
    <!-- Icon -->
  </summary>
  <div id="menu-drawer">
    <!-- Navigation content -->
  </div>
</details>

Steps to reproduce

  1. Navigate to the Accessibility Demo Store with any mobile browser (or desktop browser with a mobile viewport.)
  2. With an active screen reader, navigate to the Menu control and activate.

Behavior

Expected

  • Screen reader to announce the presence of a modal window upon activation.

Actual

  • Screen reader conveys a disclosure pattern (expanded/collapsed state) instead of a modal window.

Recommendation

  1. Remove the aria-expanded and aria-controls attributes from the summary element
  2. Add aria-modal="true", aria-label="Menu", and role="dialog" to the div#menu-drawer element
  3. Add aria-haspopup="dialog" to the summary element
  4. Add a new, visually hidden button with aria-label="Close menu" as the label inside the div#menu-drawer element
  5. Upon activation, shift focus to the Close menu button
  6. Ensure to trap keyboard foucs within the modal window
  7. Dismiss the modal window upon activation of the Close menu button or Esc key press

With this change, screen readers will announce the presence of a modal window upon activation, providing a more consistent and predictable user experience.

Recommended code

HTML

<details id="Details-menu-drawer-container">
  <summary aria-label="Menu" role="button" aria-haspopup="dialog">
    <!-- Icon -->
  </summary>
  <div id="menu-drawer" role="dialog" aria-modal="true" aria-label="Menu">
    <button type="button" aria-label="Close menu">
      <!-- Close icon -->
    </button>
    <!-- Navigation content -->
  </div>
</details>

Specifications

@svinkle svinkle added Category: Accessibility Bugs found while using assistive technology Category: Enhancement New feature or request Critical Path: 1 Affects all merchants/buyers Effort: High Severity: 3 Normal/Low Severity labels Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Accessibility Bugs found while using assistive technology Category: Enhancement New feature or request Critical Path: 1 Affects all merchants/buyers Effort: High Severity: 3 Normal/Low Severity
Projects
None yet
Development

No branches or pull requests

1 participant