Skip to content

A11y: aria-label text not visible in editor for Pagination Block if "showLabel" is unchecked #51335

@krokodok

Description

@krokodok

Description

There is a new feature to hide the label of Query Pagination Previous Block and Query Pagination Next Block inside the Query Pagination Block: #50779

We just tested this feature for accessibility. If I hide the label text, the block's text value will be used as aria-label on the previous and next buttons instead. This is fine behaviour.

But from an editor's view, it could be problematic that an editor won't know this unless he checks the frontend for accessibility. The showLabel option's label just says: "Toggle off to hide the label text, e.g. 'Next Page'." It does not give any indication that the text value will still be present in the HTML document and accessible for screen reader users. There is also no indication what the visually hidden values are, as they are completely removed from the editor once the option is enabled.

A possible real life scenario:

An editor inserts the Query Pagination Block and plays around with the previous and next labels. They write some funny text or insert Unicode characters because they want to display arrows. Then they notice the option to hide the labels and just use the preset icons instead. This is exactly what they want, and the experimentally changed texts are now hidden. In the frontend everything looks fine for visual users but screen reader users would read the non-appropriate aria-labels, not explaining what the links do.

A suggestion would be to explain to the editor that the values will still be rendered in the HTML document instead of just the current message: "Toggle off to hide the label text, e.g. 'Next Page'.". For example: "Toggle off to visually hide the label text, e.g. 'Next Page'. The text will still be used for screen readers."

We could also even dynamically display the real text values instead of just "e.g. 'Next Page'" in the Block settings.

Step-by-step reproduction instructions

  1. Insert a Query Loop Block.
  2. If not present yet, insert a Query Pagination Block.
  3. If not present yet, insert a Query Previous Block or Query Next Block.
  4. The block's values are "Previous page" and "Next page" by default.
  5. Change the values to some other text.
  6. Choose an arrow icon in the Block settings of Query Pagination block in the "Arrow" option.
  7. Un-check the now visible option "Show label" underneath the arrow option.
  8. The changed text values from the Query Previous Block or Query Next Block will not be visible in the editor anymore. To change them, you have to check "Show label" again.

Screenshots, screen recording, code snippet

Backend

grafik
grafik
grafik
grafik

Frontend

grafik

Environment info

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

Labels

[Block] Query PaginationAffects the Query Pagination Block - used for pagination within the Query Loop Block[Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).[Status] In ProgressTracking issues with work in progress[Type] CopyIssues or PRs that need copy editing assistance

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions