Skip to content

AlertDialog widget requires roles, ARIA properties, and keyboard support (Accessibility) #157207

Closed

Description

@jcollins-disney

Use case

The AlertDialog widget requires roles, ARIA properties, and expected keyboard support to meet accessibility compliance requirements outlined in the Web Content Accessibility Guidelines (WCAG).

Proposal

WAI-ARIA Roles, States, and Properties

  • The element that serves as the alert dialog container has a role="alertdialog"
  • All elements required to operate the alert dialog are descendants of the element that has role="alertdialog"
  • The alert dialog container element has aria-modal="true"
  • Provide a label for the alert dialog by using aria-label OR aria-labelledby="[IDREF]" on the container element, with [IDREF] referencing the unique ID of the element that describes the purpose of the alert dialog
  • The element with role="alertdialog" has a value set for aria-describedby that refers to the element containing the alert message.

Focus management

  • Set focus to either the alert dialog’s main heading or the first interactive element within the dialog. There must be a visible focus indicator.
  • Maintain focus within the alert dialog until the dialog is closed.
  • Upon closing the alert dialog, send focus back to the control that prompted it, or to the next logical place on the page. There must be a visible focus indicator.

Keyboard navigation

  • Tab:
    • Moves focus to the next tabbable element inside the alert dialog.
    • If focus is on the last tabbable element inside the alert dialog, moves focus to the first tabbable element inside the alert dialog.
  • Shift + Tab:
    • Moves focus to the previous tabbable element inside the alert dialog.
    • If focus is on the first tabbable element inside the alert dialog, moves focus to the last tabbable element inside the alert dialog.
  • Esc: Closes the dialog.

Activity

  1. iapicca commented on Oct 19, 2024

    @iapicca
  2. darshankawar commented on Oct 21, 2024

    @darshankawar
    Member

    The linked document mentions AlertDialg widget. @jcollins-disney I will close this in favor of the linked issue. Please follow-up in it for further updates. If you disagree, write in comments and I'll reopen it.

  3. added
    r: duplicateIssue is closed as a duplicate of an existing issue
    and removed
    in triagePresently being triaged by the triage team
    on Oct 21, 2024
  4. darshankawar commented on Oct 22, 2024

    @darshankawar
    Member

    Reopening based on #107861 (comment)

  5. added
    in triagePresently being triaged by the triage team
    c: new featureNothing broken; request for a new capability
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)
    platform-webWeb applications specifically
    and removed
    r: duplicateIssue is closed as a duplicate of an existing issue
    on Oct 22, 2024
  6. 3 remaining items

  7. added
    P2Important issues not at the top of the work list
    on Oct 31, 2024
  8. added
    P1High-priority issues at the top of the work list
    and removed
    P2Important issues not at the top of the work list
    on Jan 15, 2025
  9. self-assigned this
    on Feb 3, 2025
  10. moved this to In Progress in Framework A11y Hotliston Feb 5, 2025
  11. added
    r: fixedIssue is closed as already fixed in a newer version
    on Feb 17, 2025
  12. github-actions commented on Mar 3, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  13. locked as resolved and limited conversation to collaborators on Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)c: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Fluttercustomer: castawayframeworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)triaged-accessibilityTriaged by Framework Accessibility team

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions