0PricingLogin
Web Accessibility Academy · Lesson

Escape to Close and Restore Focus

Give a reliable exit that returns the user back.

Every Modal Needs an Exit

A modal that you cannot leave is a trap. Users expect a fast, reliable way to close it without hunting for a tiny button.

Escape Is the Universal Key

The Escape key is the agreed shortcut to dismiss a dialog. Keyboard and screen reader users reach for it first, so always support it.

All lessons in this course

  1. Dialog Roles and the Native dialog Element
  2. Trapping Focus Inside the Modal
  3. Escape to Close and Restore Focus
  4. Inert Background and aria-modal
← Back to Web Accessibility Academy