-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patterns list and grid: incorrect headings hierarchy and wrong usage of ARIA attributes #52253
Comments
Thanks so much for opening. Adding to the 6.3 board but can you clarify what beta version you're using and/or GB? |
Thank you for the detailed issue! 🙇 It might also be worth flagging some other discussion around the listbox/options implementation in #52009. It would be great to get your thoughts on the proposed solution there @afercia. I've added this to the Patterns Tracking Issue as well and will try and at least get a fix in for the headings soon while leaving any potential change to a simple list implementation as a follow-up. |
Would <li className={ patternClassNames }>
<CompositeItem
className={ previewClassNames }
{ ...composite }
onClick={ item.type !== PATTERNS ? onClick : undefined }
onKeyDown={ isUserPattern ? onKeyDown : undefined }
aria-label={ item.title }
aria-details={
ariaDescriptions.length ? descriptionId : undefined
}
>
{ isEmpty && __( 'Empty pattern' ) }
{ ! isEmpty && <BlockPreview blocks={ item.blocks } /> }
</CompositeItem>
<div hidden id={ descriptionId }>
{ ariaDescriptions.map( ( ariaDescription, index ) => (
<p key={ index }>{ ariaDescription }</p>
) ) }
</div> |
@aaronrobertshaw thanks for the fix and the ping. ❤️ Yes I think this can be closed. Nevermind: I just saw #52270 (comment) |
I don't believe we have a dedicated issue at present for this, only the in-progress PR aiming to use a simple You're welcome to add your thoughts and feedback there. Would that be sufficient or do you think we need another issue? Edit: Sorry, I already hit send before I saw your comment update 🙂 |
Description
Note: In the following screenshots, I'm using the HeadingsMap browser extension (available for Chrome and Firefox) to visually illustrate the headings in the page.
In the Site Editor > Design > Patterns, the available patterns are shown in a series of screen by type..
1
In these screens, the headings hierarchy is incorrect: it jumps from H1 level to H4:
That happens also in the 'My patterns' screen:
Additionally, all the H5 headings highlighted in the screenshot below are places within a container that user
aria-hidden="true"
. As such, they're not perceivable by assistive technologies. In any case, the H5 heading level is incorrect:These headings should either be perceivable (by removing
aria-hidden="true"
from the container) and use a correct level or not be heading. Everything is inside ARIA listbox / options and the options are labeled so I don't see the need to use a H5 in the first place. Why use a H5 and then hide it by teh means of aria-hidden?However, I'd reconsider the listbox / options implementation as it introduces unnecessary complex interaction for screen reader users. This i sjust a list of objects, visually presented in a grid. I'd recommend to use a standard list.
To my understanding, this headings part comes from previous code that was moved / rearranged to add the Patterns management screens. I guess part of the incorrect headings hierarchy comes from pre-existing code but it would be great that all developers always check the headings levels are correct, as they're of fundamental importance for screen rearer users to efficiently navigate the content. ❤️ Cc @aaronrobertshaw
2
The visually hidden description of each pattern:
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
No response
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
The text was updated successfully, but these errors were encountered: