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

Fix #657: Added aria-live to find properties results #726

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

amyyeung17
Copy link
Contributor

Description

This PR addresses issue #657. Added aria-live element that announces "You are on page #" after updating pagination.

@@ -192,6 +192,7 @@ const PropertyDetailSection: FC<PropertyDetailSectionProps> = ({
) : (
<>
<div className="flex flex-wrap flex-grow h-full min-h-[calc(100svh-101px)] max-h-[calc(100svh-101px)] mt-2">
<div aria-live="polite" className="absolute left-[-9999px]" role="status"> You are on page {page} </div>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Elements that have the role of status are implicitly aria-live polite, so you don't need to include both. I'd suggest keeping just the aria-live since it's a more well-known attribute.

Tailwind has the sr-only class. Could you use that here instead? https://tailwindcss.com/docs/screen-readers#screen-reader-only-elements

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh cool, I didn't know Tailwind had that class. :)

It seems like aria-live wasn't registering initially and only announced the page numbers when it did. Moving the div closer to where the cards rendered fixed it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

One issue with aria-live is that in order for it announce correctly the region has to be rendered on the page initially before the content change, could have been related to the rendering as you suggest.

Copy link

vercel bot commented Jul 2, 2024

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

Name Status Preview Comments Updated (UTC)
vacant-lots-proj ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 2, 2024 4:06pm

Copy link
Collaborator

@bacitracin bacitracin left a comment

Choose a reason for hiding this comment

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

Just FYI that this issue exists, I don't think they interfere with the aria live, it's more of a label on the active pagination button itself #723

@bacitracin bacitracin merged commit 9b427b8 into CodeForPhilly:staging Jul 2, 2024
3 checks passed
@CodeWritingCow CodeWritingCow added the A11y Accessibility label Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A11y Accessibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants