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

Issue fork radix-3238426

Command icon 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

xurizaemon created an issue. See original summary.

xurizaemon’s picture

Issue summary: View changes
xurizaemon’s picture

xurizaemon’s picture

Status: Active » Needs review

doxigo made their first commit to this issue’s fork.

  • doxigo committed f9b029e on 5.0.x authored by xurizaemon
    Issue #3238426 by xurizaemon: Remove redundant h4 from pagination.twig...
doxigo’s picture

doxigo’s picture

Status: Needs review » Fixed

Perfect work, merged and thanks for bringing this up

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

xurizaemon’s picture

Attaching a copy of MR !10 as of e6d8525c as Gitlab MR URLs are subject to unexpected changes (ref #3204538).