Skip to content

Pop-up on arrival blocks keyboard and screen reader users

When the page opens, a pop-up covers it: an age check, a cookie wall or a sign-up offer. On this page, keyboard users can’t reach it, Tab slips out of it to the page behind, or nothing in it can be pressed.

Why it matters

The pop-up is the first thing every visitor meets. If someone using a keyboard or a screen reader can’t get into it, answer it and get past it, they never reach the site at all.

A pop-up that covers the page may keep Tab inside it while it’s open: that’s how a modal dialog should work. What it mustn’t do is leave keyboard users outside it, or let them wander the page hidden behind it.

How to fix it

  1. Use the browser’s own dialog: a <dialog> element opened with showModal(). The browser moves focus into it, keeps the page behind it out of reach and closes it with Escape, without extra code:
    <dialog id="popup" aria-labelledby="popup-title">
      <h2 id="popup-title">…</h2>
      <button type="button">…</button>
    </dialog>
    <script>document.getElementById("popup").showModal();</script>
  2. If you can’t use <dialog>, give the pop-up role="dialog", aria-modal="true" and a name (aria-labelledby pointing to its heading), and do the rest in script: move focus into it when it opens, keep Tab inside it while it’s open, and close it with Escape.
  3. Give every button a clear name, like “Yes, I’m over 18” or “Accept cookies”, not just an icon.
  4. When it closes, return focus to the page: to where the visitor was, or to the start of the main content.
  5. Try it: reload the page and press Tab. Focus should be in the pop-up at once or after the first press, stay inside while it’s open, and every choice should work with Enter.
On Shopify
  1. Age checks and newsletter pop-ups usually come from an app or the theme. Ask the app or theme developer whether the pop-up is a modal dialog that keyboard users can reach and close; if not, switch to one that is.

Common mistakes

  • A pop-up built from a plain div with no role, so screen readers don’t announce it and Tab skips it.
  • Focus left on the page behind, so keyboard users press Tab through links they can’t see.
  • Only an icon to close it, with no name.
  • Hiding the page behind it from screen readers but never moving focus into the pop-up.

Check your fix

Once the change is live, check the page again.