Make WordPress Core

Opened 3 weeks ago

#47612 new defect (bug)

Media modal: implement a default title for the modal H1 heading

Reported by: afercia Owned by:
Milestone: 5.3 Priority: normal
Severity: normal Version:
Component: Media Keywords:
Focuses: accessibility, javascript Cc:


Splitting this out from #47145.

Now that #47145 proposes to make the Media modal a real ARIA modal dialog, it's important that the modal always has a H1 heading. This heading needs to be referenced by the aria-labelledby attribute set on the dialog container.

Currently, all the core Media modals provide a meaningful text for their H1. However, when a title is not passed to the media frame, the modal H1 is just an empty heading. An empty <h1> isn't ideal and should be avoided.

Plugins and theme authors that use wp.media() to add a media modal may miss to pass a title. As the title is of great importance to give the dialog its required accessible name, there should be a simple fallback to a default title.

Change History (0)

Note: See TracTickets for help on using tickets.