Transform to pattern menu sets ARIA roles and attributes on the wrong element #50549
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Package] Block editor
/packages/block-editor
[Type] Bug
An existing feature does not function as intended
Description
Wheb a block can be transformed to a pattern, the transform menu shows a 'Pattern' item as first item. Clicking it, shows the pattern preview. Clicking the pattern preview transforms the block.
There are a few a11y issues here:
role=option
. Instead, they're set on its parent element.Turns out this patterns list
BlockPatternsList
and pattern itemBlockPattern
use ad-hoc code instead of the general components already in use in the main inserter. Instead of repeating code, the transform menu should use the general components, which also use correct ARIA.Step-by-step reproduction instructions
role=option
doesn't have the aria-label and aria-describedby attributes.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: