Skip to content
DevMarDe
Crawl Audit check 139Crawl AuditAccessibility

Closing pop-ups and modals: Crawl Audit check 139

Crawl Audit check 139 is informational and always passes. How a modal should open and close for keyboard and screen reader users, per the W3C's pattern.

Zain Kazmi2 min read
On this page
Check
139 of 200
Module
UX & Conversion (CRO)
Group
Interactive Navigation & Layout Usability
Impact
Low

Short answer: a modal (a box that opens over the page, like a sign-up form or image viewer) must be easy to close: a visible close button, the Escape key, and focus returned to where the visitor was. Check 139 is informational and always passes: it notes whether close controls were found.

What Crawl Audit checks

  • Pass: an element labelled "close", or a close button inside something named "modal".
  • Pass: none, with a note that no modals were detected.

It can't open your modals to test them. Try each one with a keyboard.

What the W3C pattern says

  • "When a dialog opens, focus moves to an element inside the dialog."
  • "Escape: Closes the dialog."
  • When it closes, "focus returns to the element that invoked the dialog".
  • "It is strongly recommended that the tab sequence of all dialogs include a visible element with role button that closes the dialog, such as a close icon or cancel button."

The close button is a tap target too: WCAG 2.5.8 asks for at least 24 by 24 pixels (check 104).

The simplest way

The HTML <dialog> element, opened with showModal(), handles moving focus and the Escape key for you in modern browsers.

<dialog id="signup">
  <button type="button" aria-label="Close">×</button>
  ...
</dialog>

See check 109 for when not to use a pop-up at all.

Sources

All 200 Crawl Audit checks

See how your site does on every check.

Crawl Audit runs this check and 199 others on your domain. The full report is $7.89, one time. The free check on this site covers 25.