I have implemented a requirement to focus the first tab(basically an <a>
element) present inside the modal dialog.
When using NVDA screen reader to test the feature, it is observed that after reading dialog label and description (pointed by aria-labelledby and aria-describedby) it reads the focused tab element. However, after that it continues on to read the entire modal dialog content starting with modal heading. This is not the desired reading behavior we want.
If we put focus on the first input element inside the modal dialog, instead of the tab(<a>
) element, it works fine. NVDA pauses after reading the focused input element. Further elements are read out only when we navigate using tab key. This is the desired reading behavior we want, but we don't want to focus the input element.
Demo link can be found here : https://codepen.io/kaashan/pen/KOmGYe . The code used is from W3.org accessibility guidelines for modal dialogs with minor modifications to display tabs and focus the first tab element on modal open.
I am using NVDA2019.1.1 version with latest version of Chrome and Firefox browser for my tests.
Could someone help to explain what should be done to pause the NVDA after it has read the focused tab(<a>
) element?