department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
282 stars 203 forks source link

508-defect-3 [SCREENREADER]: VAOS CC Provider Select - Selected provider should be a heading and receive keyboard focus #19802

Closed 1Copenut closed 3 years ago

1Copenut commented 3 years ago

508-defect-3

Feedback framework

Definition of done

  1. Review and acknowledge feedback.
  2. Fix and/or document decisions made.
  3. Accessibility specialist will close ticket after reviewing documented decisions / validating fix.

Point of Contact

VFS Point of Contact: Trevor

User Story or Problem Statement

As a screen reader user, I would like to hear my selected provider announced once I had finished the task of picking. Some assistive technology doesn't announce focus when it is set on a container instead of a text node.

Details

The VA 508 office has flagged bold text as a heading on a recent VAOS project, so I've been looking at the selected provider and seeing an opportunity to refactor HTML. This will accomplish a couple key things:

  1. Add another heading to the page
  2. Set focus on the heading for consistent screen reader announcement Screenshot and code snippet attached below.

Acceptance Criteria

Environment

Proposed Solution (if known)

- <section
+ <div
- aria-label="Selected provider"
  id="selectedProvider"
- tabindex="-1"
>
- <span class="vads-u-display--block vads-u-font-weight--bold">DUBOSE, JOSEPH</span>
+ <h3 class="vads-u-display--block vads-u-font-weight--bold" tabindex="-1">DUBOSE, JOSEPH</h3>
  <span class="vads-u-display--block">11355 Pembrooke Sq Ste 108</span>
  <span class="vads-u-display--block">Waldorf, MD 20603</span>
  <span class="vads-u-display--block vads-u-font-size--sm vads-u-font-weight--bold">1.1 miles</span>
  <div class="vads-u-display--flex">
    <button
      class="vaos-appts__cancel-btn va-button-link vads-u-margin--0 vads-u-flex--0 vads-u-margin-right--2"
      type="button"
    >
      Change provider
    </button>
    <button
      aria-label="Remove DUBOSE, JOSEPH"
      class="vaos-appts__cancel-btn va-button-link vads-u-margin--0 vads-u-flex--0 vads-u-margin-right--2"
      type="button"
    >
      Remove
    </button>
  </div>
- </section>
+ </div>

WCAG or Vendor Guidance (optional)

Screenshots or Trace Logs

Screen Shot 2021-02-10 at 4 15 51 PM

jbalboni commented 3 years ago

@1Copenut I struggled with this one some, because of that guidance we got from the 508 office about bold text and headings. I ended up deciding not to make it a heading because the provider name seems like a bad heading. It doesn't tell you anything about the page or the content, or why that name is on the page. The only other heading on the page is the main title, which doesn't really tell you much about why a name is the next sub heading. It feels like the design intent of the bold text is mainly about emphasis the important data in that content, rather than it being a description or categorization of content. I tried to get around this issue by making a section and labeling it with what I think a reasonable heading would be (Selected provider). If it's not consistent enough to focus on the container, could we have a hidden heading that is focused?

noahgelman commented 3 years ago

@jbalboni Hidden focused elements are not ideal since their outline/border that typically displays when focused is not visible. Users can lose track of where focus is and get confused. Is your change available for me or Trevor to check out?

jbalboni commented 3 years ago

@noahgelman The most current version is up on staging, I haven't made any changes since Trevor opened the issue.

Maybe we should put some actual header text in the card itself, @outerpress. Something like "Selected provider." It just feels like if you're navigating through headings, hearing "heading level 1, Tell us your community care preferences, heading level 2, Smith, John" is confusing.

Or maybe we could mark it up like:

<h2 id="providerName">
  <span class="sr-only">Selected community care provider</span> Smith, John
</h2>

And focus on #providerName.

outerpress commented 3 years ago

@jbalboni that totally makes sense. I like the suggested header language - mockup below. A couple of notes:

I don't think any other states are affected, but let me know if I missed any.

VAOS-CC-MVP-04-v2

jbalboni commented 3 years ago

Looks good to me. We can focus on the header after adding the provider.

@LanceGundersen This should be ready for you to work on now.

1Copenut commented 3 years ago

Just getting back around on this issue and a few others. I like this approach a lot. It'll help balance what the VA 508 office asking for semantically, and bump the scannability for visual users. 👍

Let us know when you're ready to test.