-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
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
- Insert a Query Loop Block.
- If not present yet, insert a Query Pagination Block.
- If not present yet, insert a Query Previous Block or Query Next Block.
- The block's values are "Previous page" and "Next page" by default.
- Change the values to some other text.
- Choose an arrow icon in the Block settings of Query Pagination block in the "Arrow" option.
- Un-check the now visible option "Show label" underneath the arrow option.
- 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
Frontend
Environment info
- Gutenberg up from #ede0978
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



