Problem/Motivation

A screenreader user would typically use the headline-based navigation to move through views lists. That mode does ignore the load more button (semantically lacking a headline), thus giving the impression that the list has just ended there.

Futhermore, the unnecessary list markup (never containing more than that one item) creates avoidable noise.

We've conducted thinking aloud tests with screen reader users and this is the recommendation:

Proposed resolution

  1. Add a visually-hidden headline which is a pattern that can be learned and understood from other Drupal applications. Like other pagers (but different Text): <h4 id="pagination-heading" class="visually-hidden">Load more</h4>
  2. Remove all ul and li markup around the Load more button

Well aware that this can have legacy implications. Current projects might base the styling on the list markup.

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

hexabinaer created an issue. See original summary.

tobiasb’s picture

Project: Views Load More » Views Infinite Scroll
Version: 2.0.0-alpha1 » 2.0.0

Wrong module ;-)

tobiasb’s picture

Status: Active » Needs review
StatusFileSize
new1.56 KB
hexabinaer’s picture

Looks good to me (but that doesn't mean much).

WestphalDenn’s picture

As a screen reader user I am happy to see progress in accessibility enhancements. For further enhancement I'd like to suggest the following:

  • The wording "Pagination" is misleading in this case. Better: "Load more"
  • The list markup issues extra (unnecessary) output: "list with one item, link: Load more." Better completely remove the list markup, just render the Load more link.
hexabinaer’s picture

Title: Load more button should use the visually-hidden default headline of other pager variants » Make Load more markup more accessible
Issue summary: View changes
hexabinaer’s picture

Issue summary: View changes
hexabinaer’s picture

tobiasb’s picture

tobiasb’s picture

* Adder a wrapper

laura.gates’s picture

I could not get #9 and #10 to apply with Drupal 9.3.21 and version 2.0.0 of this module. #3 did apply correctly though.

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

kentr’s picture

Assigned: Unassigned » kentr
kentr’s picture

Status: Needs review » Needs work

Changing to NW until I create MR.

kentr’s picture

Version: 2.0.0 » 2.0.x-dev
Assigned: kentr » Unassigned
Status: Needs work » Needs review
StatusFileSize
new68.3 KB
new76.08 KB

There's an MR for review.

In addition to applying the patch from #10, I added support for the views pager Heading Leveloption instead of a hard-coded h4 because the accessibility checks were reporting an error about the skipped heading level.

Screenshot of error about skipped heading level from WAVE tool

Screenshot of error about skipped heading level from lighthouse accessibility audit

I've tested this manually on D11.