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

Errors and field information are not associated with their control #15302

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

Errors and field information are not associated with their control #15302

karlgroves opened this issue Apr 30, 2019 · 2 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

Errors and field information are not associated with their control

  • Severity: High
  • Affected Populations:
    • Blind
    • Low-Vision
    • Cognitively Impaired
  • Platform(s):
    • Windows - Screen Reader
    • Windows - ZoomText
    • Mac - VoiceOver
    • Android - TalkBack
    • iOS - VoiceOver
  • Components affected:
    • Media Dialog

Issue description

When users attempt to upload an image in the "Featured Image" modal
dialog, and the image is too large, an error message appears visibly.
However blind and low-vision users are not alerted with the
announcement, and focus remains on the upload button (except in Edge
browser, where focus goes back to the top of the page after a failed
upload).

The 2MB limit is also not programmatically associated with the "Select
Files" button, so blind and low-vision users may miss that limit unless
they happen to navigate past the button in exploration of the whole
modal.

Users who are zoomed-in or using magnification software may not see the
error as it may be outside their viewports. Screen reader users remain
on the "Select Files" button and need to navigate around to see if
there are any errors or if the upload was successful.

[Screenshot of the error message and the 2MB limit informative text]{.image-wrap}

Issue Code
    <button type="button" class="browser button button-hero" id="__wp-uploader-id-4" style="display: inline-block; position: relative; z-index: 1;">Select Files</button>


    ...


    <div class="upload-errors">


        <div class="upload-error">


            <span class="upload-error-filename">trump.gif</span>


            <span class="upload-error-message">trump.gif exceeds the maximum upload size for this site.</span>


        </div>


    </div>


    ...


    <div class="post-upload-ui">


        <p class="max-upload-size">Maximum upload file size: 2 MB.</p>


    </div>

Remediation Guidance

Put role=alert on the error, and on any additional error or success
messages that are added as users upload media. This will allow screen
reader users to know immediately that there is an error.

Consider moving focus to either the error container or the error
container close button when the error appears. This will ensure that
Braille-only and screen magnification users are alerted that an error
has occurred.

Normally, moving focus to errors like this is not advised, however
currently the error and the informative text are visually far away from
the "Select Files" button, and neither Braille nor screen
magnification software announce status messages. A better solution is to
change the design to bring the error visually directly under the
"Select Files" button (while still also using a live region on the
error message).

Programmatically associate the informative text ("max 2MB size") with
the "Select Files" button using aria-labelledby. Do this by giving
the informative text container an id value and set this in order in
an aria-labelledby attribute on the "Select Files" button. Include
the button's own id token in the aria-labellebdy so that the
button's text isn't overridden.

Recommended Code
    <button type="button" class="..." aria-labelledby="__wp-uploader-id-4 post-upload-info" id="__wp-uploader-id-4" style="...">Select Files</button>


    ...


    <button type="button" class="...">


        <span class="screen-reader-text">Dismiss Errors</span>


    </button>


    ...


    <div class="upload-errors">


        <div class="upload-error" role="alert">


            <h3 class="...">trump.gif</h3>


            <p class="...">trump.gif exceeds the maximum upload size for this site.</p>


        </div>


    </div>


    ...


    <div class="post-upload-ui" id="post-upload-info">


        <p class="max-upload-size">Maximum upload file size: 2 MB.</p>


    </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-60 in Tenon's report

@gziolo gziolo added the Needs Accessibility Feedback Need input from accessibility label Apr 30, 2019
@aduth aduth added this to To do in Accessibility Audit May 1, 2019
@afercia
Copy link
Contributor

afercia commented May 1, 2019

Worth noting the media modals aren't part of Gutenberg. This issue should be moved to the core Trac under the Media component.

@afercia afercia added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Feature] Media Anything that impacts the experience of managing media and removed Needs Accessibility Feedback Need input from accessibility labels May 1, 2019
@afercia
Copy link
Contributor

afercia commented May 3, 2019

@afercia afercia closed this as completed May 3, 2019
Accessibility Audit automation moved this from To do to Closed May 3, 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
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.
3 participants