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

improvement(a11y): add aria-live attribute to month name #2123

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nathansh
Copy link

@nathansh nathansh commented Jun 8, 2021

This PR addresses an issue that surfaced in a user testing session with Fable. Our test involved date selection tasks with a screenreader user.

In our testing session, I asked the screenreader user to select 2 months from today, but since the screenreader didn't read out the name of the months when changing, he had to actually count the number of months he'd gone forward. This was especially frustrating for him when he needed to go ahead 8 months.

In this solution, which was recommended by our tester, the name of the month is read out, allowing for a much easier date selection experience for screenreader users.

@ljharb
Copy link
Member

ljharb commented Jun 9, 2021

Is there an existing test or story that covers this? It’d be great to avoid regressions.

@ljharb ljharb requested a review from backwardok June 9, 2021 05:27
@nathansh
Copy link
Author

nathansh commented Jun 9, 2021

@ljharb there isn't but I'd be happy to add an assertion for the attribute in the unit test!

@backwardok
Copy link
Contributor

In the scenario where there are two months showing at once, what would the desired behavior be? I'm not 100% positive what the behavior is for different screen readers when 2 aria-live regions announce at the same time (if it queues or if one reads over the other). Should this be something that's configurable? Or should the be something where you could make more of a status update announcement (eg. "January loaded" or "January and February showing") that exists in a separate live region that can be cleared out after some time period?

@nathansh
Copy link
Author

nathansh commented Jun 10, 2021

@backwardok that's a great question! I just tested it with the macOS VoiceOver screen reader and with aria-live="polite" the screen reader read both months: "June 2021, July 2021". The tester I talked to said just reading out the names would have been what he needed, so I think that's enough to indicate to screen reader users that two months are displayed, but I could see your suggestion of something like "January and February showing" being even more helpful! I think to go that route, rather than add aria-live to the month names in the UI, it'd be better to render a piece of screen reader only text in the popup. Would you prefer I go that route? I think I'd just need to know if you have any screen reader only classes available, and how/if localization/translation is supported

@backwardok
Copy link
Contributor

@nathansh I'm not personally aware of any visually hidden text utilities in this repo (but I also don't regularly contribute to this repo so I don't know if there is one or not). Localization/translation I'd imagine would be similar to how other phrases are handled, but I think maybe for now this is probably a good start, and if there's additional feedback for improvement, things can iterate from there!

@@ -203,7 +203,7 @@ class CalendarMonth extends React.PureComponent {
isVisible,
})
) : (
<strong>
<strong aria-live="polite">
Copy link
Contributor

Choose a reason for hiding this comment

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

Recommend also adding aria-atomic="true" so that the whole phrase gets read out

Copy link
Author

Choose a reason for hiding this comment

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

@backwardok ooo thanks for the recommendation! I just added that as well :)

@ljharb ljharb requested a review from backwardok June 22, 2021 21:47
@nathansh
Copy link
Author

@backwardok are there any other pieces needed from my end? 🙂

@backwardok
Copy link
Contributor

@nathansh general code change is fine to me! Though it looks like CI is failing? Maybe need to rebase or something

@nathansh
Copy link
Author

nathansh commented Jul 1, 2021

@backwardok very strange! I just rebased with the latest master and the branch is up to date 🤔 I just took a peak at the issues travis and coveralls are reporting, and they're all with existing code. Is it possible to maybe give CI a kick to try again?

@backwardok
Copy link
Contributor

@nathansh Kicked off all the failing jobs again for you - hopefully they pass this time 🤞

@backwardok
Copy link
Contributor

hmm.. looks like they're still failing.

@ljharb do you know what's going on with the CI checks?

@nathansh
Copy link
Author

nathansh commented Aug 3, 2021

Hi @backwardok! Super sorry for being a nudge, just wanted to check in and see if there's anything I can do to help this one?

@backwardok
Copy link
Contributor

@ljharb any insights here on the failing CI checks?

@ljharb
Copy link
Member

ljharb commented Aug 3, 2021

@backwardok no, i'm not really sure - it's only failing in react 16. We might need an enzyme update, and some test tweaks, but it's tough for me to figure it out since this repo has a PR review requirement, and I'm not an admin.

@backwardok
Copy link
Contributor

@nathansh unfortunately I'm not super familiar with this code base specifically (mostly just chime in on a11y questions) and it seems like even in the main branch, CI is failing. If you're interested in digging into it at all, that would be highly appreciated! Otherwise I'm not sure exactly when folks will be able to get to it 😕

@nathansh nathansh closed this Jan 10, 2022
@ljharb ljharb reopened this Jan 10, 2022
@ljharb
Copy link
Member

ljharb commented Jan 10, 2022

@nathansh i will be able to get to this within the next month; hopefully the PR can stay open until then.

@codecov
Copy link

codecov bot commented Jan 10, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (af5d7c2) 79.56% compared to head (89c465e) 80.02%.
Report is 25 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2123      +/-   ##
==========================================
+ Coverage   79.56%   80.02%   +0.46%     
==========================================
  Files          57       57              
  Lines        2285     2303      +18     
  Branches      635      636       +1     
==========================================
+ Hits         1818     1843      +25     
+ Misses        274      271       -3     
+ Partials      193      189       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nathansh
Copy link
Author

@nathansh i will be able to get to this within the next month; hopefully the PR can stay open until then.

@ljharb absolutely! I didn't think it would move ahead so I closed it to tidy up things on my radar, but happy to keep it open!

@nathansh nathansh closed this May 3, 2023
@ljharb ljharb reopened this May 3, 2023
@nathansh
Copy link
Author

@ljharb I wouldn't mind closing this PR if it's no longer helpful/relevant/going to merge!

@ljharb
Copy link
Member

ljharb commented Jun 22, 2023

It’s still helpful and will be merged eventually :-) thanks for your patience

@nathansh
Copy link
Author

nathansh commented Feb 8, 2024

Closing as it's been open since 2021 and I can't imagine it has value anymore

@nathansh nathansh closed this Feb 8, 2024
@ljharb
Copy link
Member

ljharb commented Feb 8, 2024

I think it still has value, delay notwithstanding :-)

@ljharb ljharb reopened this Feb 8, 2024
@backwardok
Copy link
Contributor

@ljharb do you know if there's any intent to address the underlying issue with what's failing? are all PRs failing at this point?

@ljharb
Copy link
Member

ljharb commented Feb 8, 2024

@backwardok yes, i believe all PRs are failing, and I definitely have on my (sadly long) list to fix that on this repo, and rebase and hopefully land outstanding PRs.

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

Successfully merging this pull request may close these issues.

None yet

3 participants