0PricingLogin
Web Accessibility Academy · Lesson

Returning Focus When a Layer Closes

Restore the user to where they left off.

Layers Borrow Focus

When a modal, menu, or drawer opens, focus moves inside it. When it closes, you are responsible for returning focus to where the user was.

The Lost-Focus Problem

If a closed layer leaves focus on a removed element, it falls back to the page body. The user is stranded with no sense of place.

All lessons in this course

  1. tabindex 0, -1, and Never Positive
  2. Moving Focus After an Action
  3. Returning Focus When a Layer Closes
  4. Managing roving tabindex in Widgets
← Back to Web Accessibility Academy