Problem/Motivation
In #3232222: Pager template h4 can be out of document hierarchy order it's proposed to remove a <h4> element from the navigation, since the h4 is redundant and can trigger a11y warnings by being out of document order.
This same improvement applies to Radix, and IMO there's no reason to not land it here ahead of in core.
See https://git.drupalcode.org/project/radix/-/blob/5.0.x/src/components/pag...
Steps to reproduce
- See #3232222: Pager template h4 can be out of document hierarchy order, or
- Use Devel Generate to generate 50 nodes
- View the default /node view
- Observe that the headings in the document run h1 (page title), h2 (node titles), h4 (pagination), OR
- Run aXe Devtools or other a11y checker
Proposed resolution
Briefly, replace <nav class="{{ utility_classes|join(' ') }}" role="navigation" aria-labelledby="pagination-heading"><h4 id="pagination-heading" class="visually-hidden">{{ 'Pagination'|t }}</h4> with <nav class="{{ utility_classes|join(' ') }}" role="navigation" aria-label="{{ 'Pagination'|t }}">
Remaining tasks
- Patch, review, discuss, merge etc
User interface changes
Improved accessibility.
API changes
Data model changes
| Comment | File | Size | Author |
|---|
Issue fork radix-3238426
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
xurizaemonComment #3
xurizaemonComment #5
xurizaemonComment #8
doxigo commentedComment #9
doxigo commentedPerfect work, merged and thanks for bringing this up
Comment #11
xurizaemonAttaching a copy of MR !10 as of e6d8525c as Gitlab MR URLs are subject to unexpected changes (ref #3204538).