-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Fixed #35507 -- Improved accessibility using a search landmark and aria-labelledby. #19379
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
Conversation
a587d8b
to
9fb562d
Compare
Thank you @Antoliny0919! Static preview of this PR in my demo site: PR preview - Admin - Releases changelist. Can’t review just yet but changes looking reasonable. If you have the chance in the future be great for you to state in the description how exactly we’re continuing from #18256, in particular how the recommended changes there have been addressed in your new version. cc @tut-tuuut if you can review. |
Hello @thibaudcolas 🙌 I have a question regarding accessibility. ![]() However, I'm wondering if this information alone is sufficient for screen reader users to clearly understand what action each pagination button performs. For example, a button labeled “2” might not clearly communicate that it navigates to page 2. Could this be considered an area for potential accessibility improvement? |
Yes @Antoliny0919 you are right, there is room for improvement here on the paginations! Inspiration is in W3C's and UK's design systems, what I would do in summary:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, except for the redundant sr-only class.
|
||
/* ACCESSIBILITY */ | ||
|
||
.sr-only { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to add this class .sr-only
, it does the same as .visually-hidden
just above, which is already used in the admin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. 8000 Learn more.
I didn’t realize there was a class doing the same thing right above. Thank you so much tut-tuuut :)
@@ -1,6 +1,8 @@ | |||
{% load i18n static %} | |||
{% if cl.search_fields %} | |||
<div id="toolbar"><form id="changelist-search" method="get" role="search"> | |||
<div id="toolbar"> | |||
<h2 id="changelist-search-form" class="sr-only">{% blocktranslate with name=cl.opts.verbose_name_plural %}Search {{ name }}{% endblocktranslate %}</h2> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<h2 id="changelist-search-form" class="sr-only">{% blocktranslate with name=cl.opts.verbose_name_plural %}Search {{ name }}{% endblocktranslate %}</h2> | |
<h2 id="changelist-search-form" class="visually-hidden">{% blocktranslate with name=cl.opts.verbose_name_plural %}Search {{ name }}{% endblocktranslate %}</h2> |
1a0e5cf
to
469c694
Compare
Thank you for the great suggestion @tut-tuuut 💪 Pagination Area![]() Pagination Button![]() With this change, I believe screen reader users will now be able to clearly understand when they reach the pagination area and what each button within the pagination represents. |
![]() When accessing the area generated by It seems that there are still many parts that lack accessibility considerations. Since I’m not someone who uses a screen reader myself, there’s a chance I might not be able to fully assess whether certain parts truly have accessibility issues, even after doing some research. Once I’ve organized my findings, would it be okay if I request a review again? @tut-tuuut |
I agree, there is a loooong way ahead of us. I think the best would be to create a lot of tiny PRs in order not to get lost in the mass of "one more thing". The accessibility of pagination could already be moved into a dedicated PR in my opinion: I have more pagination-related improvement ideas but the original PR which adds landmarks is already good. |
I agree. |
Yes please! 🥰 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit-picks, otherwise looks good to me!
484ce8e
to
2095f2d
Compare
…in the admin changelist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Trac ticket number
ticket-35507
Branch description
Continue icastellanox's PR
I have added a label to the admin search-form following the work in #18256. As suggested by MHLut, we improve accessibility by using
aria-labelledby
to add elements that are not visually visible but can be heard by screen reader users.Checklist
main
branch.