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

ImageInput accessibility improvements #1644

Merged
merged 8 commits into from
Aug 9, 2022
Merged

Conversation

amelako
Copy link
Contributor

@amelako amelako commented Jul 4, 2022

Purpose

  • The error message in the ImageInput component is not associated with input.
  • This PR improves accessibility for the ImageInput component.

Approach and changes

  • Added aria-describedby to the Input field to associate it with the ValidationHint
  • Make the ValidationHint a live region, by passing the aria-live='polite'

Note: Currently there is an issue with VoiceOver on Mac, aria-live content is read twice for the live regions inside iframes

Definition of done

  • Development completed
  • Reviewers assigned
  • Unit and integration tests
  • Meets minimum browser support
  • Meets accessibility requirements

@sumup-clark
Copy link

sumup-clark bot commented Jul 4, 2022

Hey @amelako,
we are super excited that you are contributing! 🎉There's one more thing you need to do. Please accept our Contributor License Agreement. It helps you and us to collaborate on clear terms and focus on what we love most: code.

Thanks!

@changeset-bot
Copy link

changeset-bot bot commented Jul 4, 2022

🦋 Changeset detected

Latest commit: e497fa2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sumup/circuit-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jul 4, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
oss-circuit-ui ✅ Ready (Inspect) Visit Preview Jul 19, 2022 at 3:18PM (UTC)

@codecov
Copy link

codecov bot commented Jul 4, 2022

Codecov Report

Merging #1644 (e497fa2) into main (9f59cbd) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1644   +/-   ##
=======================================
  Coverage   91.54%   91.54%           
=======================================
  Files         195      195           
  Lines        4080     4081    +1     
  Branches     1296     1253   -43     
=======================================
+ Hits         3735     3736    +1     
- Misses        326      327    +1     
+ Partials       19       18    -1     
Impacted Files Coverage Δ
...it-ui/components/ValidationHint/ValidationHint.tsx 94.11% <ø> (ø)
...es/circuit-ui/components/ImageInput/ImageInput.tsx 83.00% <100.00%> (+0.17%) ⬆️
...es/circuit-ui/components/Pagination/Pagination.tsx 81.57% <0.00%> (ø)

Copy link
Contributor

@robinmetral robinmetral left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening the draft! Early thoughts here

packages/circuit-ui/components/ImageInput/ImageInput.tsx Outdated Show resolved Hide resolved
@@ -49,3 +49,17 @@ There are some caveats with this approach:
### Using a div element

<Story id="forms-imageinput--custom-component-div" />

## Accessibility
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm noticing other issues when using the ImageInput with Firefox and VoiceOver. Can you share your findings from SR testing so we can compare what we found and address any problems?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved it to polite after testing in isolation on storybook with Firefox,Chrome and VoiceOver. I will add recordings as reference. Let me know if you have any more findings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attaching here the recording with Firefox and VoiceOver. For some reason after my Chrome update the screen reader stopped announcing message completely when I tested in isolation. Let me know if you can try on your side and let me know the result.

Screen.Recording.2022-07-15.at.15.36.56.mov

.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue I saw (and I'm seeing it in your recording as well) is that when selecting a file, focus seems to be brought to the window, and the loading label is not announced (but that might also be because there's no live region there either 😅)

Fixing this would probably require more research though. I don't mind going ahead with this PR in the meantime.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can sync on later then on this and the docs.

@amelako amelako marked this pull request as ready for review July 15, 2022 14:57
@amelako amelako requested a review from a team as a code owner July 15, 2022 14:57
@amelako amelako requested review from robinmetral and connor-baer and removed request for a team July 15, 2022 14:57
.changeset/violet-rats-reflect.md Outdated Show resolved Hide resolved
.changeset/violet-rats-reflect.md Outdated Show resolved Hide resolved
@@ -49,3 +49,17 @@ There are some caveats with this approach:
### Using a div element

<Story id="forms-imageinput--custom-component-div" />

## Accessibility
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue I saw (and I'm seeing it in your recording as well) is that when selecting a file, focus seems to be brought to the window, and the loading label is not announced (but that might also be because there's no live region there either 😅)

Fixing this would probably require more research though. I don't mind going ahead with this PR in the meantime.

packages/circuit-ui/components/ImageInput/ImageInput.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@robinmetral robinmetral left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thank you for improving this 🙌

Would you mind creating a new issue for investigating why focus is moved to the body after selecting an image? (comment ref)

@robinmetral
Copy link
Contributor

@amelako was there anything else missing before we can merge this? I'd love to release it! 🙂

@amelako
Copy link
Contributor Author

amelako commented Aug 9, 2022

@amelako was there anything else missing before we can merge this? I'd love to release it! 🙂

No stoppers, it can be merged. Will do it now. :)

@robinmetral
Copy link
Contributor

Thanks. I also created #1705 as mentioned in a comment above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants