Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Making a Div element accessible to voice over on Mac

I am struggling to make the div with aria-label accessible.

<main>
    <h1>Heading</h1>
    <input type="text" placeholder="text">
    <p>Lorem ipsum dolor sit amet labore culpa! Ipsam.</p>
    <div role="region" aria-label="content summary">
        summary
    </div>
    <button>Go back</button>
</main>

I tried aria-describedby and aria-labelledby, but those did not work either.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Without the tabindex attribute, a <div> element is not inherently focusable. This means that most screen readers, including VoiceOver, may not navigate to it.

Here’s how you can ensure that the VoiceOver reads the div:

<div role="region" aria-label="content summary" tabindex="0">
    summary
</div> 
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading