localgovdrupal / localgov_alert_banner

Alert banner module for LocalGovDrupal
GNU General Public License v2.0
4 stars 8 forks source link

Full page alert banner - optional title display causes issues #373

Open msayoung opened 1 week ago

msayoung commented 1 week ago

On a full page alert banner we have the option to display / hide the title.

Hiding the title gives us two problems

  1. the aria-labelled by attribute points to an empty element.
  2. an empty h1 element
<dialog ... aria-labelledby="localgov-full-page-alert-banner-label" aria-describedby="localgov-full-page-alert-banner-description" open="">
 ... 
      <h1 id="localgov-full-page-alert-banner-label"></h1>
 ...
</dialog>

A dialog should have an accessible name.

My preference would be to remove the option to hide the title, but we could consider visually hiding it.

msayoung commented 1 week ago

https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/

This recommends that the value set for the aria-labelledby property refers to a visible dialog title.