Checklist Guide

A Pop-Up or Chat Window That Traps Keyboard Focus on a Practice Page

Short answer

A chat window, pop-up or menu must let a keyboard user leave it. Open each one, press Tab until you cycle around, then press Escape. If the window closes and focus returns to the button that opened it, you are fine. If nothing happens, the patient is trapped.

By Gio LaRocheUpdated 5 min read
Get my free auditor call (561) 291-2681

The window that will not let go

A patient who uses a keyboard, a switch device or a screen reader reaches your page and opens the chat bubble in the corner. Now the Tab key walks around inside the chat box and never reaches anything else. There is no visible close button they can reach, and the page behind it is locked out. The only way out is to close the browser tab, and a patient who was about to call the office is gone.

Chat widgets, appointment pop-ups, cookie notices and mobile menus are all added by plug-ins, and nobody tests them without a mouse. The trap is easy to create and easy to miss.

What the W3C actually requires

The No Keyboard Trap criterion says that if keyboard focus can be moved into a component, it must be possible to move it out again using only the keyboard. If leaving needs more than unmodified arrow or Tab keys or other standard exit methods, the user must be told how.

The W3C is also clear that a pop-up is allowed to hold focus on purpose. A modal dialog that keeps Tab cycling between its own Cancel and OK buttons does not fail, as long as the user can leave it. In its modal dialog example the dialog closes by activating Cancel, activating OK or pressing the Esc key, and the W3C describes Esc as a commonly used standard exit method.

What happens on your pageResult
Pop-up holds focus, and Escape or a reachable Close button closes itFine
Pop-up holds focus, and the only close button cannot be reached with TabTrap
Chat window swallows Tab and Escape, and the page cannot be reached againTrap
Chat window needs a special key to exit, and the page says which keyAllowed, because the user is told
Menu opens on Enter and closes on Escape, returning focus to the menu buttonFine

A three-minute test

  1. 1Open your home page and click somewhere neutral, then press Tab to start moving through the page.
  2. 2When you reach the chat bubble, the menu button or any pop-up trigger, press Enter to open it.
  3. 3Press Tab ten times. Watch the highlight: does it stay inside the window, or does it escape?
  4. 4Press Escape. The window should close, and the highlight should land back on the trigger that opened it.
  5. 5If Escape does nothing, try Shift and Tab together to move backwards, and look for a close button you can reach.
  6. 6Repeat on a phone page with an external keyboard if you can, and read the steps in our keyboard-only test for the rest of the page.

What to ask your web designer or the plug-in provider

Ask for three things in plain words: the window can be closed with the Escape key, a visible Close button can be reached with Tab, and focus goes back to the trigger afterward. If a third-party chat provider cannot do this, turn off its pop-up behavior or choose another provider. This is not legal advice, only a practical check.

While you are testing, also confirm that the pop-up does not hide the number a patient needs. A sticky bar or banner that blocks the next link is a separate problem, which we cover in sticky headers and cookie banners that cover a keyboard user's link.

Frequently asked questions

Is a pop-up that holds focus always a failure?

No. The W3C says restricting focus to a dialog is acceptable as long as the user knows how to leave it. The failure is a window with no keyboard exit.

Is Escape the only exit key?

The W3C calls Esc a commonly used standard exit method but says the exact methods depend on the hardware, browser and operating system. A reachable Close or Cancel button covers the rest.

Who is most affected by a trap?

The W3C names people who rely on a keyboard, including people who are blind and people with physical disabilities. A patient with a tremor who navigates by keyboard is as stuck as a screen reader user.

Does this apply to the mobile menu?

Yes. A menu that opens with a button should close with Escape or its own Close button, and focus should return to the menu button. Test it the same way as a chat window.

What if the chat is from an outside provider?

Test it and send the provider the three requests in this guide. If they cannot meet them, switching off the pop-up and offering a phone number and form is the safer choice for patients.

Sources

Keep reading

Ready to Grow Your Practice?

Primara is now accepting new independent practices nationwide. Most new engagements begin within one week.

Send Us a Message

We respond within one business day.

* Required field

We'll call to confirm your consultation.

No spam, ever. HIPAA-aware agency. We respond within one business day. For urgent inquiries, call (561) 291-2681.

Founder-LedHIPAA-AwareServing Practices Nationwide