amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

`amp-lightbox` should toggle the `aria-hidden` attribute when showing/hiding the lightbox

Open senthilp opened this issue 10 years ago • 2 comments

During the initial view of a page the amp-lightbox component should be hidden from screen readers. Only when activated or displayed it should be screen reader accessible. This can be done by toggling the aria-hidden attribute on the dialog element (or directly on the amp-lightbox web component).

Default state

<amp-lightbox id="my-lightbox" layout="nodisplay">
  <div class="lightbox" aria-hidden="true">
    <amp-img src="my-full-image.jpg" width=300 height=800 on="tap:my-lightbox.close">
  </div>
</amp-lightbox>

When lightbox is open

<amp-lightbox id="my-lightbox" layout="nodisplay">
  <div class="lightbox" aria-hidden="false">
    <amp-img src="my-full-image.jpg" width=300 height=800 on="tap:my-lightbox.close">
  </div>
</amp-lightbox>

This will be an a11y requirement.

senthilp avatar May 24 '16 22:05 senthilp

Lightbox pre-visibility has display: none set on it and that should be enough to hide it from screen readers.

@senthilp Are you finding it not to be the case in some cases? Could you please advise on the browser/platform where you are observing this?

dvoytenko avatar May 24 '16 22:05 dvoytenko

@dvoytenko It was reported by our internal accessibility validation tool, when it ran on the markup. We did some deep dive and it looks like display: none is sufficient to hide it for all screen readers. We will update our internal tool to reflect this. We can close the issue.

Thanks for your quick response.

senthilp avatar May 25 '16 16:05 senthilp