Insert post navigation links as two links inside a <nav> element #55157
Labels
[Block] Post Navigation Link
Affects the Post Navigation Link Block
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
New Block
Suggestion for a new block
[Type] Enhancement
A suggestion for improvement.
What problem does this address?
The post navigation link block: AKA the next and previous post links for single posts, can be difficult for users to insert correctly, because you need to add two copies of the block and then change one of the variations.
For the next and previous navigation to be as accessible as possible, both blocks needs to be placed inside a
<nav>
element.While the user can place the blocks inside a group, the group does not have an interface for changing the element from a
<div>
to a<nav>
. It can only be done by changing the code in the code editor. This limitation was created on purpose because you need advanced knowledge of when to use the<nav>
to not cause unintended accessibility problems.You can compare this with inserting the query pagination block. This block already uses a nav, and the three inner blocks are placed together: Next page, the paginated links, and previous page.
What is your proposed solution?
Instead of the inserter adding the individual next and previous links, it should prioritise a pattern where both blocks are placed in a way that ensures accessible markup.
In the example pattern below, note that besides the
<nav>
element, a unique, identifying aria label is added to the group:The text was updated successfully, but these errors were encountered: