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

Feature Image dialog does not follow the dialog pattern #15295

Closed
karlgroves opened this issue Apr 30, 2019 · 4 comments
Closed

Feature Image dialog does not follow the dialog pattern #15295

karlgroves opened this issue Apr 30, 2019 · 4 comments
Labels
[Feature] Media Anything that impacts the experience of managing media [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked.

Comments

@karlgroves
Copy link

Feature Image dialog does not follow the dialog pattern

  • Severity: High
  • Platform(s):
    • Windows - Screen Reader
    • Windows - ZoomText
    • Mac - VoiceOver
    • Android - TalkBack
    • iOS - VoiceOver
  • Components affected:
    • Media Dialog

Issue description

Users opening the "Feature Image" dialog are not told they are
entering a dialog. Keyboard focus is trapped, however screen reader
users are able to go beyond the last items of the dialog without
realising they have left it.

Keyboard users who find their focus cycling around the dialog get a Tab
stop with no visible focus. This is the dialog itself, which can receive
keyboard focus while having no visible focus state.

The triggering "Set Featured Image" button does not express an
expanded or collapsed state, which would not matter if users could not
reach the button when the modal was open; however, they can.

Lack of an explicit role for modal dialogs may be confusing for
assistive technology users, since they may not realise they're inside a
dialog, and that consequently the keyboard interactions may be different
from the rest of the page. Lack of an explicit label for dialogs may be
confusing for assistive technology users, since they won't have an
immediate sense of what the dialog is for.

Issue Code
    <button type="button" class="components-button editor-post-featured-image__toggle">Set featured image</button>


    ...


    <div tabindex="0" class="media-modal wp-core-ui">


        <button type="button" class="...">...Close media panel...</button>


        <div class="media-modal-content">


            ...


            <div class="media-frame-title">


                <h1>Featured Image<span class="dashicons dashicons-arrow-down"></span></h1>


            </div>


            ...


        </div>


    </div>

Remediation Guidance

Give the modal a role of dialog and set "aria-modal=true".
Additionally, set aria-hidden="true" on the element which wraps
the rest of the page, to prevent older browsers or assistive
technologies that don't support aria-modal from accessing the rest
of the page while the modal is open.

Use aria-labelledby and an id on the modal heading to name the
modal.

Change the tabindex to -1 so that it can be focused via
JavaScript without being in the Tab order. The exception to this advice
is if having the modal in the Tab order is necessary so that keyboard
users can scroll content inside it; however in existing cases,
scrollable areas are separate parts of the modal. But if a container
must receive focus in order to allow keyboard users to scroll the
content, then the container must visibly show focus.

Recommended Code
    <div id="wpwrap" aria-hidden="true">...</div>





    <div role="dialog" aria-modal="true" aria-labelledby="media-modal-title" tabindex="-1" class="media-modal wp-core-ui">


        <button type="button" class="...">...Close media panel...</button>


        <div class="media-modal-content">


            ...


            <div class="media-frame-title">


                <h1 id="media-modal-title">Featured Image<span class="dashicons dashicons-arrow-down"></span></h1>


            </div>


            ...


        </div>


    </div>

Relevant standards

Note: This issue may be a duplicate with other existing accessibility-related bugs in this project. This issue comes from the Gutenberg accessibility audit, performed by Tenon and funded by WP Campus. This issue is GUT-42 in Tenon's report

@gziolo gziolo added the Needs Accessibility Feedback Need input from accessibility label Apr 30, 2019
@swissspidy swissspidy added the [Feature] Media Anything that impacts the experience of managing media label May 1, 2019
@aduth aduth added this to To do in Accessibility Audit May 1, 2019
@afercia
Copy link
Contributor

afercia commented May 4, 2019

As the media modals aren't part of Gutenberg, this issue should be moved to Trac.

And yes, unfortunately the Media Views are one of the most inaccessible parts in WordPress. Several long standing tickets on Trac.

@afercia afercia added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). and removed Needs Accessibility Feedback Need input from accessibility labels May 4, 2019
@melchoyce
Copy link
Contributor

Full report screenshot:

image

@melchoyce melchoyce moved this from To do to Move to Trac in Accessibility Audit May 5, 2019
@gziolo gziolo added the [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked. label May 6, 2019
@anevins12
Copy link
Contributor

anevins12 commented May 6, 2019

Moved to Trac: https://core.trac.wordpress.org/ticket/47145

@afercia
Copy link
Contributor

afercia commented May 6, 2019

Closing as moved to Trac.

@afercia afercia closed this as completed May 6, 2019
Accessibility Audit automation moved this from Move to Trac to Closed May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media Anything that impacts the experience of managing media [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked.
Projects
Development

No branches or pull requests

6 participants