Describe the bug
The Image/Image Box block fails accessibility audits when a link is applied to the block.
Image Box block: Has an aria-label, but it is incorrectly placed on the outer <div>
Image block: The linked <a> has no aria-label at all
To Reproduce
Steps to reproduce the behavior:
- Add an Image Block
- Add a Link to the block
- Check on frontend
- See error in Lighthouse ""Links must have discernible text"
Expected behavior
When a value is provided, the accessibility label should be applied directly to the generated <a> element, ensuring that the link has a discernible and accessible name.
For the Image Box block, the label should no longer be applied only to the outer <div> container. For the Image block, the label should be added to the linked <a> element.
Describe the bug
The Image/Image Box block fails accessibility audits when a link is applied to the block.
Image Box block: Has an aria-label, but it is incorrectly placed on the outer
<div>Image block: The linked
<a>has no aria-label at allTo Reproduce
Steps to reproduce the behavior:
Expected behavior
When a value is provided, the accessibility label should be applied directly to the generated
<a>element, ensuring that the link has a discernible and accessible name.For the Image Box block, the label should no longer be applied only to the outer
<div>container. For the Image block, the label should be added to the linked<a>element.