Fixes #292 - "Playground block: A11Y: Remove duplicate main landmarks"
This PR replaces the Playground block's <main> element with a <section> element annotated with an aria-label.
Why?
There is only supposed to be one <main> element per document. We do not know if a document including a Playground block will be rendered within another <main> element, and there can be multiple Playground blocks in a single document.
Testing Instructions
npx nx run wordpress-playground-block:dev
Create a new post
Add a Playground block in the editor and confirm it renders normally
Publish the post and confirm the Playground block renders normally on the front end
Use screen reader and confirm that the section label is noted when engaging with the section
What?
Fixes #292 - "Playground block: A11Y: Remove duplicate main landmarks"
This PR replaces the Playground block's
<main>
element with a<section>
element annotated with anaria-label
.Why?
There is only supposed to be one
<main>
element per document. We do not know if a document including a Playground block will be rendered within another<main>
element, and there can be multiple Playground blocks in a single document.Testing Instructions
npx nx run wordpress-playground-block:dev