Skip to content

Refactor Modal components to implement strict ARIA accessibility standards #110

Description

@Lakes41

Difficulty: Intermediate
Type: UI/UX, accessibility

Background

The application heavily utilizes popup modals for confirmations, settings, and token selections. These were built quickly using basic absolute positioning.

Problem

The current modals trap visual focus but lack proper ARIA attributes, meaning screen readers cannot properly announce the modal's presence, title, or purpose to visually impaired users.

Expected outcome

All primary modals are updated to strictly adhere to W3C WAI-ARIA authoring practices for Dialog (Modal) widgets.

Suggested implementation

  1. Add role="dialog" and aria-modal="true" to the modal wrappers.
  2. Ensure the modal container includes aria-labelledby pointing to the modal's title ID, and aria-describedby pointing to its body ID.
  3. Verify that focus is actively trapped within the modal while open, and restored to the trigger element when closed.

Acceptance criteria

  • Screen readers properly announce the modal when it opens.
  • Users can navigate through all modal elements using only the Tab key.
  • Pressing Escape reliably closes the modal.

Likely affected files/directories

  • src/components/UI/Modal.tsx

Requirements

  • Consider migrating to @radix-ui/react-dialog primitives if the custom implementation is too brittle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSRelated to GrantFox Open Source Software initiativesMaybe RewardedPotential for a reward based on contributionOfficial Campaign | FWC26Period after the official FIFA World Cup 2026 campaignUI/UXUser interface or user experience relatedintermediateGood for intermediate level contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions