8000 Ticket #35507 changed to search landmark in filter sidebar in order to improve accessibility. by icastellanox · Pull Request #18256 · django/django · GitHub
[go: up one dir, main page]

Skip to content

Ticket #35507 changed to search landmark in filter sidebar in order to improve accessibility. #18256

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

Closed
wants to merge 1 commit into from

Conversation

icastellanox
Copy link
@icastellanox icastellanox commented Jun 8, 2024

Trac ticket number

ticket-35507

Branch description

changed to search landmark in filter sidebar in order to improve accessibility.

Checklist

  • This PR targets the main branch.
  • The commit message is written in past tense, mentions the ticket number, and ends with a period.
  • I have checked the "Has patch" ticket flag in the Trac system.
  • I have added or updated relevant tests.
  • I have added or updated relevant docs, including release notes if applicable.
  • I have attached screenshots in both light and dark modes for any UI changes.

Copy link
@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hello! Thank you for your contribution 💪

As it's your first contribution be sure to check out the patch review checklist.

If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket!

If you have any design or process questions then you can ask in the Django forum.

Welcome aboard ⛵️!

@knyghty knyghty requested a review from a team June 8, 2024 15:48
Copy link
Member
@thibaudcolas thibaudcolas left a comment

Choose a reason for hiding this comment

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

Working great, thank you @icastellanox!

Copy link
Contributor
@sarahboyce sarahboyce left a comment

Choose a reason for hiding this comment

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

Roughly adding the same comment in the ticket but this basically reverts the work of ticket-34835 which was introduced in 5.1, makes me think we should backport this to 5.1 before the beta freeze and mark this as a release blocker if we are instead saying this is in fact more accurate. Otherwise, we can close this ticket and PR as wontfix.

We will also need to update the release note added in ticket-34835.
cc @django/accessibility team for advice here

@@ -73,7 +73,7 @@
</div>
{% block filters %}
{% if cl.has_filters %}
<nav id="changelist-filter" aria-labelledby="changelist-filter-header">
Copy link
Contributor

Choose a reason for hiding this comment

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

We also have <form id="changelist-search" method="get" role="search"> in django/contrib/admin/templates/admin/search_form.html should we add an aria-label here as described in labelling landmarks?

Copy link
Member

Choose a reason for hiding this comment

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

We should yes. For some reason I thought we had this already but it looks like I was looking at the wrong thing.

Copy link
Contributor
@MHLut MHLut Jul 29, 2024

Choose a reason for hiding this comment

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

It's better to use a heading and aria-labelledby, because:

  1. Screen reader users can navigate using headings.
  2. aria-label doesn't get translated by translation tools including, but not limited to, Google Translate.

Copy link
Contributor
@gtossou gtossou Mar 2, 2025

Choose a reason for hiding this comment

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

Hi. I would like to give a help on this ticket. Could you give me some explanation about the change required regarding the heading and aria-labelledby please ? Thanks

Copy link
Member

Choose a reason for hiding this comment

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

In the template Sarah mentioned there's a <form> element with role="search", which makes this element act the same as a <search> element. Since these types of landmark elements need labels, we should add something here. I think if we go with the approach @MHLut suggests we should add a <h2> with class="sr-only", an id and some descriptive text, maybe just "Search" is enough, or maybe "Search <model.verbose_name_plural>" - I don't think we want this visible - and then we can add that ID to the form's -aria-labelledby` attribute.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok if i understand well, the finally solution would replace the nav element with a form (having a role="search). And next to it a h2, right ?

@MHLut
Copy link
Contributor
MHLut commented Jul 29, 2024

Is there anything still blocking this backport? It looks good to me.

@sarahboyce
Copy link
Contributor

This comment hasn't been addressed

@smithdc1
Copy link
Member

Continued in #19379

@smithdc1 smithdc1 closed this Apr 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Assignees
No one assigned
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants
0