WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: aria-hidden for content outside modal dialog?

for

From: Tim Harshbarger
Date: Oct 16, 2015 11:49AM


If you are using aria-hidden, there is a "gotcha" you might want to be mindful of.

Using either aria-hidden="true" or aria-hidden="false" overrides the default behavior of the screen reader. Normally, the screen reader will read whatever is visible and ignore content hidden with techniques like "display: none". SO, you should only ever use the aria-hidden attribute if you want to override the default behavior.

What this means with regard to the dialog is that if you use aria-hidden="true" to hide the background content, you will then want to remove the aria-hidden attribute completely when the dialog disappears. Otherwise you are likely to find the screen reader reading content that you don't intend it to read.