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

sul23-289 - aria atomic #98

Merged
merged 2 commits into from
Feb 9, 2024
Merged

Conversation

mdyoung3
Copy link
Contributor

@mdyoung3 mdyoung3 commented Jan 12, 2024

READY FOR REVIEW

  • (Edit the above to reflect status)

Summary

Review By (Date)

  • When does this need to be reviewed by?
    Jan 23

Urgency

  • How critical is this PR?
  • Low

Steps to Test

  1. Do this
  2. Then this
  3. Then this

Affected Projects or Products

  • Does this PR impact any particular projects, products, or modules?

Associated Issues and/or People

  • JIRA ticket
  • Other PRs
  • Any other contextual information that might be helpful (e.g., description of a bug that this PR fixes, new functionality that it adds, etc.)
  • Anyone who should be notified? (@mention them here)

See Also

@mdyoung3 mdyoung3 requested a review from pookmish January 18, 2024 20:48
@@ -132,7 +132,7 @@ const StudyPlacesFiltering = ({items}: {items: StudyPlace[]}) => {
</Conditional>

<Conditional showWhen={items.length > 0}>
<p aria-live="polite">
<p aria-live="polite" aria-atomic="true">
Copy link
Contributor

Choose a reason for hiding this comment

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

Was there a requirement for this? To my understanding, this has no different affect since there are no child nodes within this element. There's only the 1 node that changes which is reflected to the screen reader on each change. If the html was structured like below, it would be appropriate:

<p...>
showing <strong>{length}</strong> of {total}
</p>

The way I read the documentation is that if length changed, that would be the only thing that would be read out to the screen reader. aria-atomic=true would read out the whole thing if anything inside it changed.

Also on this documentation it explains that with a ul/li list of users, when a new li element is added/removed screen readers only read that change, not the whole list. But then turning on atomic would read out the entire list each time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The way I read the documentation is that if length changed, that would be the only thing that would be read out to the screen reader. aria-atomic=true would read out the whole thing if anything inside it changed.

This is how I interpret the documentation on aria-atomic. However:

TBD: Realistic use case for aria-atomic="true"

This doesn't bode well. Seems like there's not a good rules for this?

(The example page has multiple version, one example fits using an aria-atomic set to 'true'. https://pauljadam.com/demos/aria-atomic-relevant.html)

That is to say, I don't interpret this as a hard and fast rule, but a guideline. If you're using a screen reading, does it make more sense to has it say "x of 42" each time it updates? I suspect that would make more sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doing some light research in the WCAG docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not able to find a definitive answer to this. I ran axetools on both branches but the test didn't state having it on or off as an issue. To me, this confirms that it's not necessary but nice to have.

Not sure if it would be an issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since SODA did review this form and the aria attributes. I don't see a reason to push this up at this time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry. I should have sent this to you sooner.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. Ok, as annoying as it is that they didn't notice it the first several times, thanks for that!

@mdyoung3 mdyoung3 changed the title sul23-289 - aria live sul23-289 - aria atomic Feb 7, 2024
@pookmish pookmish changed the base branch from 1.x to release-1.0.1 February 9, 2024 17:08
Copy link

vercel bot commented Feb 9, 2024

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

Name Status Preview Updated (UTC)
su-library ✅ Ready (Inspect) Visit Preview Feb 9, 2024 5:13pm

@pookmish pookmish merged commit b5590a9 into release-1.0.1 Feb 9, 2024
2 of 3 checks passed
@pookmish pookmish deleted the SUL23-289-aria-label-results branch February 9, 2024 17:09
@pookmish pookmish mentioned this pull request Feb 22, 2024
pookmish added a commit that referenced this pull request Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants