Accessibility of detail modal

Created on 26 November 2024, about 2 months ago

Problem/Motivation

The first focused element on the modal once it's opened is typically the first link that appears inside the project description. However, not all project descriptions have a link. It's possible for a non-sighted user to miss the description, for example.

See https://www.drupal.org/project/project_browser/issues/3310908#comment-15... โœจ Consider making 'detail page' a modal window instead of a separate "page" in app Active for more background.

Steps to reproduce

use project browser, find a project, click its title to open the modal "detail page"

Proposed resolution

MAYBE: add a focusable element (The title?) to the modal?

MAYBE: make the first focusable element the close button?

๐Ÿ“Œ Task
Status

Active

Version

2.0

Component

User experience

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @chrisfromredfin
  • First commit to issue fork.
  • Merge request !632#3489972:Accessibility of detail modal โ†’ (Merged) created by utkarsh_33
  • Pipeline finished with Failed
    about 2 months ago
    Total: 400s
    #351835
  • Pipeline finished with Success
    about 2 months ago
    Total: 339s
    #351842
  • I have implemented one of the two suggestions.

  • Pipeline finished with Success
    about 2 months ago
    Total: 370s
    #356233
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia narendraR Jaipur, India

    Asserting focus in exiting modal test can be helpful here.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    adding a tabindex to non-interactive is not adviced (see for example https://www.a11yproject.com/posts/how-to-use-the-tabindex-attribute/). https://html.spec.whatwg.org/dev/interactive-elements.html#the-dialog-el... suggests

    As such, authors should use the autofocus attribute on the descendant element of the dialog that the user is expected to immediately interact with after the dialog opens. If there is no such element, then authors should use the autofocus attribute on the dialog element itself.

    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog suggests:

    The autofocus attribute should be added to the element the user is expected to interact with immediately upon opening a modal dialog. If no other element involves more immediate interaction, it is recommended to add autofocus to the close button inside the dialog, or the dialog itself if the user is expected to click/activate it to dismiss.

    i would rather lean toward the smallest commone denominator between the two aka focus on the dialog element itself instead of focusing on the close button cuz the intend of the dialog modal is that some browsing of the content and interaction with the elements in the modal happens. but i guess it would make sense to also start thinking and opening a follow up issue about the general structure of the dialog modal content (implementing the things we'Ve learned from the survey and which got aggregated into the quality indicators.png)

  • Not sure whether there is a better way of doing this but now the focus is on the modal element.Marking it NR.

  • Pipeline finished with Success
    about 2 months ago
    Total: 385s
    #358703
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia narendraR Jaipur, India

    Tested manually and focus is now set on modal. Moving it to RTBC.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 448s
    #363135
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    thanks for the changes... the dialog modal getting the initial focus looks good... but i've noticed several more problems in the context of the a11y within the dialog modal. so far i have only tested it with modules that havent had an image carousel, plus i havent taken a closer look with voiceover active neither (see and hear dialog.mp4 and voiceover.mp4).

    • with the dialog modal being the first element in focus it feels sort of odd to have the close button as the second in the tabindex? would it be possible and be better if the close button would become the last in the tabindex in the dialog modal?
    • the back and forth buttons of the image carousel in the dialog modal are missing a visible focus outline (SC2.4.7).
    • The labels for the next button with "slide right" is not clear (why not use something like "next image" and "previous image") in particular due to the fact that all the images in the carousel are labeled as decorational. with only two images you only have a single button cuz the other is disabled. with more than two images you then have a slide left and slide right buttons but no content you the user are sliding inbetween.
    • the disabled button is not reflected in the aural interface and that way things might become confusing for screenreader users. using aria-disabled="true" instead of disabled would make the disabled button tabable and labeled as dimmed/disabled in for example voicover
    • the tab order is odd. as demonstrated in voiceover.mp4, if the focus is on the slide right button, you press return and the button turns disabled and you press shift-tab to get back to the slide left button you get to the learn more button instead?!
    • in dialog.mp4 and voiceover.mp4 i manage each time to get with the focus outside the dialog modal into the background of the modal which should not happen.

    i set the issue back to needs work. the other option might be to move some of those points to follow up issues to keep the scope for this issue, but due to the fact that this issue is about the a11y of the dialog modal i set it back to needs work for now

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine

    Actually, each of these bullets should be its own sub-issue. If you want to collect all modal-related a11y issues, you can do a meta and do each bullet as a child; but, we need to keep scope as SMALL as possible for issues. Moving this one back to RTBC.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine
  • Pipeline finished with Success
    about 1 month ago
    Total: 445s
    #365978
  • Pipeline finished with Success
    about 1 month ago
    Total: 437s
    #365979
  • Pipeline finished with Skipped
    about 1 month ago
    #365984
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine

    There will be more a11y fixes coming, but I aim to try to keep them as small and narrowly scoped as possible.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024